-
Notifications
You must be signed in to change notification settings - Fork 17.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/go: convert tests using testdata/src/syntaxerror to scripts
This includes TestMatchesNoTestsDoesNotOverrideBuildFailure and TestErrorMessageForSyntaxErrorInTestGoFileSaysFAIL. Convert the tests that use the testdata/src/syntaxerror directory to the script framework. Part of converting all tests to script framework to improve test parallelism. Updates #36320 Updates #17751 Change-Id: I2b2b616e8c124996ae8c8e5b737f15bb493ec588 Reviewed-on: https://go-review.googlesource.com/c/go/+/212816 Run-TryBot: Michael Matloob <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Jay Conrod <[email protected]>
- Loading branch information
Showing
5 changed files
with
29 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/cmd/go/testdata/script/test_match_no_tests_build_failure.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Test that when there's a build failure and a -run flag that doesn't match, | ||
# that the error for not matching tests does not override the error for | ||
# the build failure. | ||
|
||
! go test -run ThisWillNotMatch syntaxerror | ||
! stderr '(?m)^ok.*\[no tests to run\]' | ||
stdout 'FAIL' | ||
|
||
-- syntaxerror/x.go -- | ||
package p | ||
-- syntaxerror/x_test.go -- | ||
package p | ||
|
||
func f() (x.y, z int) { | ||
} |
14 changes: 14 additions & 0 deletions
14
src/cmd/go/testdata/script/test_syntax_error_says_fail.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Test that the error message for a syntax error in a test go file | ||
# says FAIL. | ||
|
||
! go test syntaxerror | ||
stderr 'x_test.go:' # check that the error is diagnosed | ||
stdout 'FAIL' # check that go test says FAIL | ||
|
||
-- syntaxerror/x.go -- | ||
package p | ||
-- syntaxerror/x_test.go -- | ||
package p | ||
|
||
func f() (x.y, z int) { | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.