File tree 2 files changed +22
-2
lines changed
2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,26 @@ see following paragraph):
59
59
``` shell
60
60
task test-integration
61
61
```
62
+ ### Running only some tests
63
+ By default, all tests from all go packages are run. To run only unit
64
+ tests from one or more specific packages, you can set the TARGETS
65
+ environment variable, e.g.:
66
+
67
+ TARGETS=./arduino/cores/packagemanager task test-unit
68
+
69
+ Alternatively, to run only some specific test(s), you can specify a regex
70
+ to match against the test function name:
71
+
72
+ TEST_REGEX='^TestTryBuild.*' task test-unit
73
+
74
+ Both can be combined as well, typically to run only a specific test:
75
+
76
+ TEST_REGEX='^TestFindBoardWithFQBN$' TARGETS=./arduino/cores/packagemanager task test-unit
77
+
78
+ For integration test, the same options are supported. Note that when not
79
+ specified, ` TEST_REGEX ` defaults to "Integration" to select only
80
+ integration tests, so if you specify a broader regex, this could cause
81
+ non-integration tests to be run as well.
62
82
63
83
### Integration tests
64
84
Original file line number Diff line number Diff line change @@ -21,12 +21,12 @@ tasks:
21
21
test-unit :
22
22
desc : Run unit tests only
23
23
cmds :
24
- - go test -short {{ default "-v" .GOFLAGS }} -coverprofile=coverage_unit.txt {{ default .DEFAULT_TARGETS .TARGETS }} {{.TEST_LDFLAGS}}
24
+ - go test -short -run '{{ default ".*" .TEST_REGEX }}' {{ default "-v" .GOFLAGS }} -coverprofile=coverage_unit.txt {{ default .DEFAULT_TARGETS .TARGETS }} {{.TEST_LDFLAGS}}
25
25
26
26
test-integration :
27
27
desc : Run integration tests only
28
28
cmds :
29
- - go test -run Integration {{ default "-v" .GOFLAGS }} -coverprofile=coverage_integ.txt {{ default .DEFAULT_TARGETS .TARGETS }} {{.TEST_LDFLAGS}}
29
+ - go test -run '{{ default " Integration" .TEST_REGEX }}' {{ default "-v" .GOFLAGS }} -coverprofile=coverage_integ.txt {{ default .DEFAULT_TARGETS .TARGETS }} {{.TEST_LDFLAGS}}
30
30
- pytest test
31
31
32
32
test-legacy :
You can’t perform that action at this time.
0 commit comments