Skip to content

Commit 08e35cc

Browse files
dmitshurgopherbot
authored andcommitted
all: use ^$ instead of XXXX, NoSuchTestExists to match no tests
It's shorter and can't accidentally match unlikely test names. Change-Id: I96dd9da018cad1acf604f266819470278f54c128 Reviewed-on: https://go-review.googlesource.com/c/go/+/524949 Auto-Submit: Dmitri Shuralyov <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> Reviewed-by: Tobias Klauser <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
1 parent 0dfb22e commit 08e35cc

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

src/cmd/cgo/internal/test/issue18146.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func test18146(t *testing.T) {
7272
}()
7373
}
7474
runtime.GOMAXPROCS(threads)
75-
argv := append(os.Args, "-test.run=NoSuchTestExists")
75+
argv := append(os.Args, "-test.run=^$")
7676
if err := syscall.Exec(os.Args[0], argv, os.Environ()); err != nil {
7777
t.Fatal(err)
7878
}

src/cmd/go/testdata/script/test_fuzz_minimize_interesting.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ go run check_cache/check_cache.go $GOCACHE/fuzz/FuzzMinCache
2121
# Test that minimization occurs for a crash that appears while minimizing a
2222
# newly found interesting input. There must be only one worker for this test to
2323
# be flaky like we want.
24-
! exec ./fuzz.test$GOEXE -test.fuzzcachedir=$GOCACHE/fuzz -test.fuzz=FuzzMinimizerCrashInMinimization -test.run=XXX -test.fuzztime=10000x -test.parallel=1
24+
! exec ./fuzz.test$GOEXE -test.fuzzcachedir=$GOCACHE/fuzz -test.fuzz=FuzzMinimizerCrashInMinimization -test.run=^$ -test.fuzztime=10000x -test.parallel=1
2525
! stdout '^ok'
2626
stdout -count=1 'got the minimum size!'
2727
stdout -count=1 'bad input'
@@ -32,7 +32,7 @@ go run check_testdata/check_testdata.go FuzzMinimizerCrashInMinimization 1
3232

3333
# Test that a nonrecoverable error that occurs while minimizing an interesting
3434
# input is reported correctly.
35-
! exec ./fuzz.test$GOEXE -test.fuzzcachedir=$GOCACHE/fuzz -test.fuzz=FuzzMinimizerNonrecoverableCrashInMinimization -test.run=XXX -test.fuzztime=10000x -test.parallel=1
35+
! exec ./fuzz.test$GOEXE -test.fuzzcachedir=$GOCACHE/fuzz -test.fuzz=FuzzMinimizerNonrecoverableCrashInMinimization -test.run=^$ -test.fuzztime=10000x -test.parallel=1
3636
! stdout '^ok'
3737
stdout -count=1 'fuzzing process hung or terminated unexpectedly while minimizing'
3838
stdout -count=1 'EOF'

src/net/http/serve_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4992,7 +4992,7 @@ func benchmarkClientServerParallel(b *testing.B, parallelism int, mode testMode)
49924992
// For use like:
49934993
//
49944994
// $ go test -c
4995-
// $ ./http.test -test.run=XX -test.bench='^BenchmarkServer$' -test.benchtime=15s -test.cpuprofile=http.prof
4995+
// $ ./http.test -test.run='^$' -test.bench='^BenchmarkServer$' -test.benchtime=15s -test.cpuprofile=http.prof
49964996
// $ go tool pprof http.test http.prof
49974997
// (pprof) web
49984998
func BenchmarkServer(b *testing.B) {
@@ -5031,7 +5031,7 @@ func BenchmarkServer(b *testing.B) {
50315031
defer ts.Close()
50325032
b.StartTimer()
50335033

5034-
cmd := testenv.Command(b, os.Args[0], "-test.run=XXXX", "-test.bench=^BenchmarkServer$")
5034+
cmd := testenv.Command(b, os.Args[0], "-test.run=^$", "-test.bench=^BenchmarkServer$")
50355035
cmd.Env = append([]string{
50365036
fmt.Sprintf("TEST_BENCH_CLIENT_N=%d", b.N),
50375037
fmt.Sprintf("TEST_BENCH_SERVER_URL=%s", ts.URL),
@@ -5086,7 +5086,7 @@ func BenchmarkClient(b *testing.B) {
50865086

50875087
// Start server process.
50885088
ctx, cancel := context.WithCancel(context.Background())
5089-
cmd := testenv.CommandContext(b, ctx, os.Args[0], "-test.run=XXXX", "-test.bench=^BenchmarkClient$")
5089+
cmd := testenv.CommandContext(b, ctx, os.Args[0], "-test.run=^$", "-test.bench=^BenchmarkClient$")
50905090
cmd.Env = append(cmd.Environ(), "TEST_BENCH_SERVER=yes")
50915091
cmd.Stderr = os.Stderr
50925092
stdout, err := cmd.StdoutPipe()

src/os/executable_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func TestExecutable(t *testing.T) {
3030
t.Fatalf("filepath.Rel: %v", err)
3131
}
3232

33-
cmd := testenv.Command(t, fn, "-test.run=XXXX")
33+
cmd := testenv.Command(t, fn, "-test.run=^$")
3434
// make child start with a relative program path
3535
cmd.Dir = dir
3636
cmd.Path = fn

0 commit comments

Comments
 (0)