Skip to content

Commit ed7176f

Browse files
Improve documentation on running tests
This more verbosely explains what the -v and -timeout options are for (and removes them from the default command shown). Also, this adds info on how to run a single test. Signed-off-by: Matthijs Kooijman <[email protected]>
1 parent 7fb7e76 commit ed7176f

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

Diff for: README.md

+25-2
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,37 @@ go build arduino.cc/arduino-builder
7575
In order to run the tests, type:
7676

7777
```
78-
go test -timeout 60m -v ./src/arduino.cc/builder/test/...
78+
go test arduino.cc/builder/test
79+
```
80+
81+
This runs all tests, showing any failures and a summary at the end.
82+
Add the -v option to show each test as it is being ran. Currently,
83+
arduino-builder itself also generates copious output, even for
84+
non-failing testcases and without -v, and testing does not stop at the
85+
first failure, so you probably want to redirect test output so you can
86+
scroll back to find any failures.
87+
88+
To run a single test, use the -run option, which accepts a regular
89+
expression (see also go help testflag).
90+
91+
```
92+
go test arduino.cc/builder/test -run 'TestBuilderEmptySketch'
93+
go test arduino.cc/builder/test -run 'TestPrototypesAdder.*'
7994
```
8095

8196
In jenkins, use
8297
```
83-
go test -timeout 60m -v ./src/arduino.cc/builder/test/... | bin/go-junit-report > report.xml
98+
go test -v arduino.cc/builder/test | bin/go-junit-report > report.xml
8499
```
85100

101+
The first time you run the tests, some needed files (toolchains and
102+
source files) will be downloaded, which needs about 1GB of space (at the
103+
time of writing). If you have a slow connection, this download might
104+
exceed the default 10 minute timeout for a single test. If you run into
105+
this, add `-timeout 60m` or similar to the commandline to extend the
106+
timeout. If you are running on slower system (like a rasbperry pi),
107+
increasing the timeout might be needed as well.
108+
86109
### License and Copyright
87110

88111
`arduino-builder` is licensed under General Public License version 2, as published by the Free Software Foundation. See [LICENSE.txt](LICENSE.txt).

0 commit comments

Comments
 (0)