Skip to content

Commit 4c463af

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 79df13b commit 4c463af

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

README.md

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,37 @@ go build arduino.cc/arduino-builder
7676
In order to run the tests, type:
7777

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

8297
In jenkins, use
8398
```
84-
go test -timeout 60m -v ./src/arduino.cc/builder/test/... | bin/go-junit-report > report.xml
99+
go test -v arduino.cc/builder/test | bin/go-junit-report > report.xml
85100
```
86101

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

89112
`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)