runtests
run the test files in a specific directory and path.
Jive.runtests โ Function
runtests(dir::String ;
failfast::Bool = false,
targets::Union{AbstractString, Vector{<: AbstractString}} = String[],
skip::Union{Vector{Any}, Vector{<: AbstractString}} = String[],
filter_testset::Union{Nothing, AbstractString, Vector{<: AbstractString}, Regex, Base.Callable} = nothing,
into::Union{Nothing, Module} = nothing,
enable_distributed::Bool = true,
node1::Union{Vector{Any}, Vector{<: AbstractString}} = String[],
verbose::Bool = true)::Totalrun the test files from the specific directory.
dir: the root directory to traverse.failfast: aborting on the first failure. be overridden when theENVvariableJULIA_TEST_FAILFASThas set.targets: filter targets and start.(space) separatedStringor aVector{String}. be overridden whenARGSare not empty.skip: files or directories to skip. be overridden when theENVvariableJIVE_SKIPhas set.,(comma) separated.testset_filter: filter testset. default isnothing.into: a module that to be used inBase.include.nothingmeans to be safe that using anonymous module for every test file.enable_distributed: option for distributed. be overridden when theENVvariableJIVE_PROCShas set.node1: run on node 1 during for the distributed tests.verbose: print details of test execution
suppose you have some test files in the test/ directory for your package.
now let's make your test/runtests.jl with
using Jive
runtests(@__DIR__)for the runtests.jl, ARGS are used to filter the targets and to set the start offset of the tests.
~/.julia/dev/Jive/test $ julia runtests.jl jive/s start=3
1/4 jive/skip/skip-calls.jl --
2/4 jive/skip/skip-exprs.jl --
3/4 jive/skip/skip-functions.jl
Pass 4 (0.40 seconds)
4/4 jive/skip/skip-modules.jl
Pass 4 (0.01 seconds)
โ
All 8 tests have been completed. (0.62 seconds)in the above example, test files are matched for only have jive/s and jumping up to the 3rd file.
set JULIA_TEST_VERBOSE=true to print the detailed hierarchical test summaries.
~/.julia/dev/Jive/test $ JULIA_TEST_VERBOSE=true julia test/testset.jl
Starting testset: basic
Finished testset: basic (0.0s)
Test Summary: | Pass Total Time
basic | 1 1 0.0s
~/.julia/dev/Jive/test $ JULIA_TEST_VERBOSE=true julia runtests.jl test/testset.jl
1/1 test/testset.jl
Test Summary: | Pass Total Time
basic | 1 1 0.1s
Pass: 1 (compile: 0.28, recompile: 0.09, elapsed: 0.28 seconds)
โ
All 1 test has been completed. (compile: 0.28, recompile: 0.09, elapsed: 0.28 seconds)Refer to the docs/runtests for details.
TestJive.jl is an example package for using Jive.
look at also the test/Project.toml file for your own package.
[deps]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Jive = "ba5e3d4b-8524-549f-bc71-e76ad9e9deed"
[targets]
test = ["Test", "Jive"]
[compat]
Jive = "0.3"See TestJiveRunMoreTests.jl to care the advanced cases.