|
1 | | -names = [ |
2 | | - "test_states.jl", |
3 | | - |
4 | | - "test_operators.jl", |
5 | | - "test_operators_dense.jl", |
6 | | - "test_sparsematrix.jl", |
7 | | - "test_operators_sparse.jl", |
8 | | - "test_operators_lazytensor.jl", |
9 | | - "test_operators_lazysum.jl", |
10 | | - "test_operators_lazyproduct.jl", |
11 | | - "test_time_dependent_operators.jl", |
12 | | - |
13 | | - "test_fock.jl", |
14 | | - "test_charge.jl", |
15 | | - "test_spin.jl", |
16 | | - "test_particle.jl", |
17 | | - "test_manybody.jl", |
18 | | - "test_nlevel.jl", |
19 | | - "test_subspace.jl", |
20 | | - "test_state_definitions.jl", |
21 | | - |
22 | | - "test_sciml_broadcast_interfaces.jl", |
23 | | - |
24 | | - "test_transformations.jl", |
25 | | - |
26 | | - "test_metrics.jl", |
27 | | - "test_embed.jl", |
28 | | - |
29 | | - "test_superoperators.jl", |
30 | | - |
31 | | - "test_pauli.jl", |
32 | | - "test_spinors.jl", |
33 | | - |
34 | | - "test_abstractdata.jl", |
35 | | - |
36 | | - "test_printing.jl", |
37 | | - |
38 | | - "test_apply.jl", |
39 | | - |
40 | | - "test_aqua.jl", |
41 | | - "test_jet.jl" |
42 | | -] |
43 | | - |
44 | | -detected_tests = filter( |
45 | | - name->startswith(name, "test_") && endswith(name, ".jl"), |
46 | | - readdir(".")) |
47 | | - |
48 | | -unused_tests = setdiff(detected_tests, names) |
49 | | -if length(unused_tests) != 0 |
50 | | - error("The following tests are not used:\n", join(unused_tests, "\n")) |
51 | | -end |
52 | | - |
53 | | -unavailable_tests = setdiff(names, detected_tests) |
54 | | -if length(unavailable_tests) != 0 |
55 | | - error("The following tests could not be found:\n", join(unavailable_tests, "\n")) |
| 1 | +using TestItemRunner |
| 2 | +using QuantumOpticsBase |
| 3 | + |
| 4 | +# filter for the test |
| 5 | +testfilter = ti -> begin |
| 6 | + exclude = Symbol[] |
| 7 | + if get(ENV,"JET_TEST","")=="true" |
| 8 | + return :jet in ti.tags |
| 9 | + else |
| 10 | + push!(exclude, :jet) |
| 11 | + end |
| 12 | + if !(VERSION >= v"1.10") |
| 13 | + push!(exclude, :aqua) |
| 14 | + push!(exclude, :doctests) |
| 15 | + end |
| 16 | + |
| 17 | + return all(!in(exclude), ti.tags) |
56 | 18 | end |
| 19 | +println("Starting tests with $(Threads.nthreads()) threads out of `Sys.CPU_THREADS = $(Sys.CPU_THREADS)`...") |
57 | 20 |
|
58 | | -for name=names |
59 | | - if startswith(name, "test_") && endswith(name, ".jl") |
60 | | - include(name) |
61 | | - end |
62 | | -end |
| 21 | +@run_package_tests filter=testfilter |
0 commit comments