Skip to content

Commit

Permalink
cmd/compile/internal/gc: make tests run faster
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Brad Fitzpatrick <[email protected]>
  • Loading branch information
josharian committed Nov 3, 2016
1 parent 827f2ac commit 6650448
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/cmd/compile/internal/gc/asm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions src/cmd/compile/internal/gc/ssa_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 6650448

Please sign in to comment.