(debug bool, agent string, extra ...string)
| 8 | ) |
| 9 | |
| 10 | func RunUncoverAndGetResults(debug bool, agent string, extra ...string) ([]string, error) { |
| 11 | cmd := exec.Command("bash", "-c") |
| 12 | cmdLine := fmt.Sprintf("%s %s ", "./uncover", agent) |
| 13 | cmdLine += strings.Join(extra, " ") |
| 14 | cmd.Args = append(cmd.Args, cmdLine) |
| 15 | fmt.Println(cmd.Args) |
| 16 | if debug { |
| 17 | cmd.Args = append(cmd.Args, "-v") |
| 18 | cmd.Stderr = os.Stderr |
| 19 | fmt.Println(cmd.String()) |
| 20 | } else { |
| 21 | cmd.Args = append(cmd.Args, "-silent") |
| 22 | } |
| 23 | data, err := cmd.Output() |
| 24 | if debug { |
| 25 | fmt.Println(string(data)) |
| 26 | } |
| 27 | if err != nil { |
| 28 | return nil, err |
| 29 | } |
| 30 | var parts []string |
| 31 | items := strings.Split(string(data), "\n") |
| 32 | for _, i := range items { |
| 33 | if i != "" { |
| 34 | parts = append(parts, i) |
| 35 | } |
| 36 | } |
| 37 | return parts, nil |
| 38 | } |
| 39 | |
| 40 | // TestCase is a single integration test case |
| 41 | type TestCase interface { |
no outgoing calls
no test coverage detected
searching dependent graphs…