Skip to content

Latest commit

 

History

History
48 lines (36 loc) · 2.42 KB

README.md

File metadata and controls

48 lines (36 loc) · 2.42 KB

TestRunner

A test runner library for Julia

Build Status Build status

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")

Basics

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 given TestStructureNode
  • line - returns line at which given TestStructureNode starts in tests source code
  • name - returns name of given TestStructureNode. For @fact it is the custom error messages passed as second argument, for facts and context it is the description providede as first argument.
  • result - returns result of the assertion as RESULT enum. Works only for FactNode type. Possible results are:
    • test_success
    • test_failure
    • test_error
    • test_pending
    • test_not_run
  • details - returns message which would be printed by FactCheck as output of given test. Works only for FactNode type.
  • stacktrace - returns the stacktrace for given FactNode. It will not be an empty string only for nodes with result test_error.

Limitations

  • 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.