Esempio n. 1
0
func main() {
	flag.Parse()
	log.Printf(initialConfiguration, host, port, nap, cover)

	working := getWorkDir()
	cover = coverageEnabled(cover, reports)
	shell := system.NewShell(gobin, reports, cover, timeout)

	watcherInput := make(chan messaging.WatcherCommand)
	watcherOutput := make(chan messaging.Folders)
	excludedDirItems := strings.Split(excludedDirs, `,`)
	watcher := watch.NewWatcher(working, depth, nap, watcherInput, watcherOutput, watchedSuffixes, excludedDirItems)

	parser := parser.NewParser(parser.ParsePackageResults)
	tester := executor.NewConcurrentTester(shell)
	tester.SetBatchSize(packages)

	longpollChan := make(chan chan string)
	executor := executor.NewExecutor(tester, parser, longpollChan)
	server := api.NewHTTPServer(working, watcherInput, executor, longpollChan)
	go runTestOnUpdates(watcherOutput, executor, server)
	go watcher.Listen()
	go launchBrowser(host, port)
	serveHTTP(server)
}
Esempio n. 2
0
func main() {
	flag.Parse()
	log.Printf(initialConfiguration, host, port, nap, cover)

	working, err := os.Getwd()
	if err != nil {
		log.Fatal(err)
	}

	cover = coverageEnabled(cover, reports)
	shell := system.NewShell(gobin, reports, cover, timeout)

	watcherInput := make(chan messaging.WatcherCommand)
	watcherOutput := make(chan messaging.Folders)
	watcher := watch.NewWatcher(working, depth, nap, watcherInput, watcherOutput, watchedSuffixes)

	parser := parser.NewParser(parser.ParsePackageResults)
	tester := executor.NewConcurrentTester(shell)
	tester.SetBatchSize(packages)

	longpollChan := make(chan chan string)
	executor := executor.NewExecutor(tester, parser, longpollChan)
	server := api.NewHTTPServer(working, watcherInput, executor, longpollChan)

	go runTestOnUpdates(watcherOutput, executor, server)
	go watcher.Listen()
	serveHTTP(server)
}