(testName string)
| 849 | } |
| 850 | |
| 851 | func findPackagesFor(testName string) []string { |
| 852 | if len(testName) == 0 { |
| 853 | return []string{} |
| 854 | } |
| 855 | |
| 856 | cmd := command("ack", testName, *baseDir, "-l") |
| 857 | var b bytes.Buffer |
| 858 | cmd.Stdout = &b |
| 859 | if err := cmd.Run(); err != nil { |
| 860 | fmt.Printf("Unable to find %s: %v\n", *runTest, err) |
| 861 | return []string{} |
| 862 | } |
| 863 | |
| 864 | var dirs []string |
| 865 | scan := bufio.NewScanner(&b) |
| 866 | for scan.Scan() { |
| 867 | fname := scan.Text() |
| 868 | if strings.HasSuffix(fname, "_test.go") { |
| 869 | dir := strings.Replace(filepath.Dir(fname), *baseDir, "", 1) |
| 870 | dirs = append(dirs, dir) |
| 871 | } |
| 872 | } |
| 873 | fmt.Printf("dirs: %+v\n", dirs) |
| 874 | return dirs |
| 875 | } |
| 876 | |
| 877 | type pkgDuration struct { |
| 878 | threadId int32 |
no test coverage detected
searching dependent graphs…