You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Initial support for skipping testitems
* Add some tests
* Simplify module building
* Test skipped testitems have empty stats
* WIP integration tests for skipping testitems
* more tests
* more tests 2
* docs
* Test JUnit report for skipped test-items
* cleanup
* Fixup block expr test on v1.10
* Update README.md
Co-authored-by: Nathan Daly <NHDaly@gmail.com>
* Update src/macros.jl
Co-authored-by: Nathan Daly <NHDaly@gmail.com>
* Remove unused file
* Fix and test log alignment
* Print SKIP in warning color
* Emphasise difference between `skip` and filtering `runtests`
* fixup! Emphasise difference between `skip` and filtering `runtests`
* Bump version
* fixup! Fix and test log alignment
---------
Co-authored-by: Nathan Daly <NHDaly@gmail.com>
The `setup` is run once on each worker process that requires it;
131
148
it is not run before every `@testitem` that depends on the setup.
132
149
150
+
#### Skipping tests
151
+
152
+
The `skip` keyword can be used to skip a `@testitem`, meaning no code inside that test-item will run.
153
+
A skipped test-item logs that it is being skipped and records a single "skipped" test result, similar to `@test_skip`.
154
+
155
+
```julia
156
+
@testitem"skipped" skip=truebegin
157
+
@testfalse
158
+
end
159
+
```
160
+
161
+
If `skip` is given as an `Expr`, it must return a `Bool` indicating whether or not to skip the test-item.
162
+
This expression will be run in a new module similar to a test-item immediately before the test-item would be run.
163
+
164
+
```julia
165
+
# Don't run "orc v1" tests if we don't have orc v1
166
+
@testitem"orc v1" skip=:(using LLVM; !LLVM.has_orc_v1()) begin
167
+
# tests
168
+
end
169
+
```
170
+
171
+
The `skip` keyword allows you to define the condition under which a test needs to be skipped,
172
+
for example if it can only be run on a certain platform.
173
+
See [filtering tests](#filtering-tests) for controlling which tests run in a particular `runtests` call.
174
+
133
175
#### Post-testitem hook
134
176
135
177
If there is something that should be checked after every single `@testitem`, then it's possible to pass an expression to `runtests` using the `test_end_expr` keyword.
0 commit comments