Josh Bleecher Snyder | e157fac | 2017-07-24 10:17:15 -0700 | [diff] [blame] | 1 | The test directory contains tests of the Go tool chain and runtime. |
| 2 | It includes black box tests, regression tests, and error output tests. |
| 3 | They are run as part of all.bash. |
| 4 | |
| 5 | To run just these tests, execute: |
| 6 | |
Dmitri Shuralyov | 7a0799b | 2023-02-08 11:40:06 -0500 | [diff] [blame] | 7 | ../bin/go test internal/testdir |
Josh Bleecher Snyder | e157fac | 2017-07-24 10:17:15 -0700 | [diff] [blame] | 8 | |
zdjones | a58a8d2 | 2020-07-16 12:33:25 +0100 | [diff] [blame] | 9 | To run just tests from specified files in this directory, execute: |
| 10 | |
Dmitri Shuralyov | 7a0799b | 2023-02-08 11:40:06 -0500 | [diff] [blame] | 11 | ../bin/go test internal/testdir -run='Test/(file1.go|file2.go|...)' |
zdjones | a58a8d2 | 2020-07-16 12:33:25 +0100 | [diff] [blame] | 12 | |
Josh Bleecher Snyder | e157fac | 2017-07-24 10:17:15 -0700 | [diff] [blame] | 13 | Standard library tests should be written as regular Go tests in the appropriate package. |
| 14 | |
| 15 | The tool chain and runtime also have regular Go tests in their packages. |
| 16 | The main reasons to add a new test to this directory are: |
| 17 | |
| 18 | * it is most naturally expressed using the test runner; or |
| 19 | * it is also applicable to `gccgo` and other Go tool chains. |