Documentation | Build Status (Jive.jl) | Build Status (TestJiveRunMoreTests.jl) | Coverage |
---|---|---|---|
Jive.jl
is a Julia package to help the writing tests.
- βοΈ You can make a donation to support this project.
run the test files in a specific directory and path.
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.
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.
skip the expression.
using Jive # @skip
@skip println(1+2)
used to run the block only once.
using Jive # @onlyonce
for _ in 1:10
@onlyonce begin
println(42)
end
@onlyonce(println("hello"))
end
evaluate the module by the condition.
using Jive # @If
@If VERSION >= v"1.1.0-DEV.764" module load_some_module
end
use inside of the module.
using Jive # @useinside
@useinside module test_pkgs_flux_optimise
# ...
end
Main
is the module to evaluate in.
@useinside Main module test_pkgs_flux_optimise
# ...
end
throw(Jive.EndError())
using Jive
@__END__
test/jive/__REPL__
- Use Infiltrator.jl to debug the local scope variables.
~/.julia/dev/Jive/test/jive/__REPL__ $ cat test.jl
using Jive
a = 1
@__REPL__
@info :a a
~/.julia/dev/Jive/test/jive/__REPL__ $ julia test.jl
julia> a += 2
3
julia> ^D # Ctrl + D to exit the REPL
β Info: a
β a = 3
Make function f
uncallable.
same for Base.delete_method(only(methods(f, types)))
sprint_plain
: getBase.show
text/plain output of thex
sprint_colored
: getBase.show
text/plain output of thex
with colorsprint_html
: getBase.show
text/html output of thex
See also TestRunner.jl.