-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rework the tests to use TestItems (probably should have been a separa…
…te PR)
- Loading branch information
Showing
7 changed files
with
37 additions
and
28 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
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,34 +1,20 @@ | ||
using SafeTestsets | ||
using BPGates | ||
using TestItemRunner | ||
|
||
function doset(descr) | ||
if length(ARGS) == 0 | ||
return true | ||
end | ||
for a in ARGS | ||
if occursin(lowercase(a), lowercase(descr)) | ||
return true | ||
end | ||
end | ||
return false | ||
end | ||
# filter for the test | ||
testfilter = ti -> begin | ||
exclude = Symbol[] | ||
if get(ENV,"JET_TEST","")!="true" | ||
push!(exclude, :jet) | ||
end | ||
if !(VERSION >= v"1.10") | ||
push!(exclude, :doctests) | ||
push!(exclude, :aqua) | ||
end | ||
|
||
macro doset(descr) | ||
quote | ||
if doset($descr) | ||
@safetestset $descr begin include("test_"*$descr*".jl") end | ||
end | ||
end | ||
return all(!in(exclude), ti.tags) | ||
end | ||
|
||
println("Starting tests with $(Threads.nthreads()) threads out of `Sys.CPU_THREADS = $(Sys.CPU_THREADS)`...") | ||
|
||
@doset "quantumclifford" | ||
@doset "quantikz" | ||
get(ENV,"JET_TEST","")=="true" && @doset "jet" | ||
@doset "doctests" | ||
|
||
using Aqua | ||
doset("aqua") && begin | ||
Aqua.test_all(BPGates) | ||
end | ||
@run_package_tests filter=testfilter |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
@testitem "Aqua analysis" begin | ||
|
||
using Aqua, BPGates | ||
|
||
Aqua.test_all(BPGates) | ||
|
||
end |
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,5 +1,9 @@ | ||
@testitem "doctests" begin | ||
|
||
using Documenter | ||
using BPGates | ||
|
||
DocMeta.setdocmeta!(BPGates, :DocTestSetup, :(using QuantumClifford, BPGates); recursive=true) | ||
doctest(BPGates) | ||
|
||
end |
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
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
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