module util::Test
rascal-0.34.0
Provides occasionally useful access to Rascal's testing framework
Usage
import util::Test;
Dependencies
extend Message;
Description
Rascal's test framework can normally be accessed via UI and commandline interfaces:
- Running as JUnit tests in IDEs
- Running as JUnit tests from Maven
- Executing the
:test
command in a Rascal REPL
This module provides a programmatic interface, and reports the test results as values. It can be handy to construct more UI components which interact with tests, but also to query larger volumes of failing tests.
data TestResult
data TestResult
= \testResult(str name, bool success, loc src, str message = "", list[value] exceptions = [])
;
function runTests
Run all tests for the given module name
list[TestResult] runTests(str moduleName)
This function works under the assumption that the named module is available in the current execution environment.
Tests
test testTest
private test bool testTest() = true;