Recently I've been working on a new Testing framework RunTests.jl . It is a test runner inspired by python's pytest that aims to improve testing without bloating your code with loads of boilerplate. In its simplest form RunTests.jl can save you from writing run_tests.jl
scripts that look like this:
my_tests = ["test/sometests.jl",
"test/somemoretests.jl",
"test/evenmoretests.jl"]
println("Running tests:")
for my_test in my_tests
include(my_test)
end
and allows you to write them, more simply, like this:
using RunTests
exit(run_tests())
But it has more to offer than that! RunTests.jl builds on top of Julia's Base.Test
library to make it easy to add structure to your tests. Structuring your tests with RunTests.jl gives the following advantages:
STDOUT
and STDERR
output from each test is captured and reported along with the details of the test failure.@skipif
and mark failing tests with @xfail
.@parameterize
you can run the same test again again with different parameters and see which pass and which fail.