This package collects some extensions and convenience utilities to maximize your testing enjoyment. It builds on the new
Test infrastructure in Julia v0.5 (also available in v0.4 with the
BaseTestNext package). It's designed so that you shouldn't need to modify your tests at all if you're already using
@test - all the interactions with this package happen at the top-level of your tests.
ExtendedTestSet type makes your test output more readable. It outputs green dots as your tests pass, so you can have a sense of progress. It also displays diffs on test failure using the
DeepDiffs package. To use it, simply add
ExtendedTestSet as a custom testset type to your top-level
@testset, and then use
Test functions as usual. All nested testsets will use it automatically.
using Compat.Test using TestSetExtensions @testset ExtendedTestSet "All the tests" begin @testset "2nd-level tests 1" begin @test true @test 1 == 1 end @testset "2nd-level tests 2" begin @test true @test 1 == 1 end end
TestSetExtensions also provides a
@includetests macro that makes it easy to selectively run your tests, for cases when your full test suite is large and you only need to run a subset of your tests to test a feature you're working on. The macro takes a list of test files, so you can pass it
ARGS to allow the user to specify which tests to run from the command line.
using Compat.Test using TestSetExtensions @testset "All the tests" begin @includetests ARGS end
If the user doesn't provide any command-line arguments, this will look for any
*.jl files in the same directory as the running file (usually
include them. The user can also specify a list of test files:
$ julia test/runtests.jl footests bartests
Which will run
@includetests will print out each test module name as it goes (here in combination with
about 2 months ago