func (self *Watcher) includeFolders(path string, info os.FileInfo, err error) error { if info.IsDir() { log.Println("Including:", path) self.watched[path] = contract.NewPackage(path) } return nil }
func extractPackages(folderList messaging.Folders) []*contract.Package { packageList := []*contract.Package{} for _, folder := range folderList { hasImportCycle := testFilesImportTheirOwnPackage(folder.Path) packageList = append(packageList, contract.NewPackage(folder, hasImportCycle)) } return packageList }
func runTestOnUpdates(queue chan messaging.Folders, executor contract.Executor, server contract.Server) { for update := range queue { log.Println("Received request from watcher to execute tests...") root := "" packages := []*contract.Package{} for _, folder := range update { root = folder.Root packages = append(packages, contract.NewPackage(folder)) } output := executor.ExecuteTests(packages) server.ReceiveUpdate(root, output) } }
func (self *Watcher) Creation(folder string) { log.Println("Detected creation of:", folder) self.watched[folder] = contract.NewPackage(folder) }