-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix test filter logic - format more like QuantumClifford PR
- Loading branch information
Showing
1 changed file
with
12 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,22 @@ | ||
using QuantumSavory | ||
using TestItemRunner | ||
|
||
function doset(tag) | ||
if length(ARGS) == 0 | ||
return true | ||
end | ||
for a in ARGS | ||
if occursin(lowercase(a), lowercase(String(tag))) | ||
return true | ||
end | ||
end | ||
if get(ENV,"JET_TEST","")=="true" && tag == :jet | ||
return true | ||
end | ||
if get(ENV,"QUANTUMSAVORY_PLOT_TEST","")=="true" | ||
if tag in [:plotting_gl, :plotting_cairo] | ||
return true | ||
end | ||
if VERSION >= v"1.9" && tag == :doctests | ||
return true | ||
function testfilter(tags) | ||
exclude = Symbol[] | ||
# Only do the plotting tests if the ENV variable `QUANTUMSAVORY_PLOT_TEST` is set | ||
if get(ENV,"QUANTUMSAVORY_PLOT_TEST","")!="true" | ||
push!(exclude, :plotting_cairo) | ||
push!(exclude, :plotting_gl) | ||
if VERSION >= v"1.9" | ||
push!(exclude, :doctests) | ||
end | ||
end | ||
if tag in [:examples, :aqua] | ||
return true | ||
if get(ENV,"JET_TEST","")!="true" | ||
push!(exclude, :jet) | ||
end | ||
|
||
return false | ||
return all(!in(exclude), tags) | ||
end | ||
|
||
println("Starting tests with $(Threads.nthreads()) threads out of `Sys.CPU_THREADS = $(Sys.CPU_THREADS)`...") | ||
|
||
@run_package_tests filter=ti->any([doset(tag) for tag in ti.tags]) | ||
@run_package_tests filter=ti->testfilter(ti.tags) |