summaryrefslogtreecommitdiffhomepage
path: root/test/runner
diff options
context:
space:
mode:
Diffstat (limited to 'test/runner')
-rw-r--r--test/runner/gtest/gtest.go21
-rw-r--r--test/runner/main.go1
2 files changed, 17 insertions, 5 deletions
diff --git a/test/runner/gtest/gtest.go b/test/runner/gtest/gtest.go
index 38e57d62f..affbf1973 100644
--- a/test/runner/gtest/gtest.go
+++ b/test/runner/gtest/gtest.go
@@ -133,17 +133,28 @@ func ParseTestCases(testBin string, benchmarks bool, extraArgs ...string) ([]Tes
}
// Run again to extract benchmarks.
- args = append([]string{listBenchmarkFlag}, extraArgs...)
- cmd = exec.Command(testBin, args...)
- out, err = cmd.Output()
+ tb, err := ParseBenchmarks(testBin, extraArgs...)
+ if err != nil {
+ return nil, err
+ }
+ t = append(t, tb...)
+ return t, nil
+}
+
+// ParseBenchmarks returns each benchmark in a third_party/benchmark binary's list as a single test case.
+func ParseBenchmarks(binary string, extraArgs ...string) ([]TestCase, error) {
+ var t []TestCase
+ args := append([]string{listBenchmarkFlag}, extraArgs...)
+ cmd := exec.Command(binary, args...)
+ out, err := cmd.Output()
if err != nil {
// We were able to enumerate tests above, but not benchmarks?
// We requested them, so we return an error in this case.
exitErr, ok := err.(*exec.ExitError)
if !ok {
- return nil, fmt.Errorf("could not enumerate gtest benchmarks: %v", err)
+ return nil, fmt.Errorf("could not enumerate benchmarks: %v", err)
}
- return nil, fmt.Errorf("could not enumerate gtest benchmarks: %v\nstderr\n%s", err, exitErr.Stderr)
+ return nil, fmt.Errorf("could not enumerate benchmarks: %v\nstderr\n%s", err, exitErr.Stderr)
}
benches := strings.Trim(string(out), "\n")
diff --git a/test/runner/main.go b/test/runner/main.go
index 34e9c6279..2cab8d2d4 100644
--- a/test/runner/main.go
+++ b/test/runner/main.go
@@ -170,6 +170,7 @@ func runRunsc(tc gtest.TestCase, spec *specs.Spec) error {
"-network", *network,
"-log-format=text",
"-TESTONLY-unsafe-nonroot=true",
+ "-TESTONLY-allow-packet-endpoint-write=true",
"-net-raw=true",
fmt.Sprintf("-panic-signal=%d", unix.SIGTERM),
"-watchdog-action=panic",