A test runner library for Julia
TestRunner.jl
is a Julia test runner library used by standalone Tk based GUITestRunner and atom-julia-test-runner extension for Atom. It can parse FactCheck tests and run them returning results as an information rich, tree structure.
MIT Licensed - see LICENSE.md
Installation: julia> Pkg.clone("https://github.com/gdziadkiewicz/TestRunner.jl")
Test file structure parsing:
using TestRunner
testFilePath = "tests.jl"
structure = get_test_structure(testFilePath)
Running tests from file:
using TestRunner
testFilePath = "tests.jl"
results = run_all_tests(testFilePath)
Both structure and results are returned as a tree of TestStructureNode
objects.
Functions designed to retrieve informations from the nods:
children
- returns children of givenTestStructureNode
line
- returns line at which givenTestStructureNode
starts in tests source codename
- returns name of givenTestStructureNode
. For@fact
it is the custom error messages passed as second argument, forfacts
andcontext
it is the description providede as first argument.result
- returns result of the assertion asRESULT
enum. Works only forFactNode
type. Possible results are:test_success
test_failure
test_error
test_pending
test_not_run
details
- returns message which would be printed byFactCheck
as output of given test. Works only forFactNode
type.stacktrace
- returns the stacktrace for givenFactNode
. It will not be an empty string only for nodes with resulttest_error
.
- At the moment TestRunner does not handle any kind of branching logic in tests(there are plans to fix this issue as soon as Julia 0.5 gets released).
- TestRunner does not support macro generated tests.