| 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 |
|
| 7 |
../bin/go test cmd/internal/testdir |
| 8 |
|
| 9 |
To run just tests from specified files in this directory, execute: |
| 10 |
|
| 11 |
../bin/go test cmd/internal/testdir -run='Test/(file1.go|file2.go|...)' |
| 12 |
|
| 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. |