]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile/internal/gc: make tests run faster
authorJosh Bleecher Snyder <josharian@gmail.com>
Thu, 3 Nov 2016 00:55:29 +0000 (17:55 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Thu, 3 Nov 2016 01:07:08 +0000 (01:07 +0000)
TestAssembly takes 20s on my machine,
which is too slow for normal operation.
Marking as -short has its dangers (#17472),
but hopefully we'll soon have a builder for that.

All the SSA tests are hermetic and not time sensitive
and can thus be run in parallel.
Reduces the cmd/compile/internal/gc test time during
all.bash on my laptop from 42s to 7s.

Updates #17751

Change-Id: Idd876421db23b9fa3475e8a9b3355a5dc92a5a29
Reviewed-on: https://go-review.googlesource.com/32585
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/compile/internal/gc/asm_test.go
src/cmd/compile/internal/gc/ssa_test.go

index b0635cd308b95b5e7e47f844e2a21a60b037e615..58cdb9da7d75d31e3bda6b6b9d366d161591e02c 100644 (file)
@@ -21,6 +21,9 @@ import (
 // TestAssembly checks to make sure the assembly generated for
 // functions contains certain expected instructions.
 func TestAssembly(t *testing.T) {
+       if testing.Short() {
+               t.Skip("slow test; skipping")
+       }
        testenv.MustHaveGoBuild(t)
        if runtime.GOOS == "windows" {
                // TODO: remove if we can get "go tool compile -S" to work on windows.
index debdc4386bd8f3b0f7bbdce4340c0f56aa1e9879..1aebd9031133e88cf506c3747866be332077b4a7 100644 (file)
@@ -16,9 +16,11 @@ import (
 // TODO: move all these tests elsewhere?
 // Perhaps teach test/run.go how to run them with a new action verb.
 func runTest(t *testing.T, filename string) {
+       t.Parallel()
        doTest(t, filename, "run")
 }
 func buildTest(t *testing.T, filename string) {
+       t.Parallel()
        doTest(t, filename, "build")
 }
 func doTest(t *testing.T, filename string, kind string) {