Base class for test classes that define tests that parse and build LF files from the TestRegistry.
More...
Inherits org.lflang.tests.LfInjectedTestBase.
Inherited by org.lflang.tests.RuntimeTest, org.lflang.tests.runtime.CArduinoTest, org.lflang.tests.runtime.CCppTest, org.lflang.tests.runtime.CFlexPRETTest, org.lflang.tests.runtime.CPatmosTest, org.lflang.tests.runtime.CSchedulerTest, org.lflang.tests.runtime.CVerifierTest, org.lflang.tests.runtime.CZephyrTest, org.lflang.tests.runtime.CppRos2Test, and org.lflang.tests.serialization.SerializationTest.
|
| static final String | THICK_LINE |
| | Content separator used in test output, 78 characters wide.
|
| static final String | THIN_LINE |
| | Content separator used in test output, 78 characters wide.
|
|
| void | applyDefaultConfiguration (TargetConfig config) |
| | Adjust target configuration for all runs of this test class.
|
| ProcessBuilder | getExecCommand (LFTest test) throws TestError |
| | Return a preconfigured ProcessBuilder for executing the test program.
|
| GeneratorArguments | getGeneratorArguments () |
| | Return generator arguments suitable for testing.
|
| final void | runTestsAndPrintResults (Target target, Predicate< TestCategory > selected, TestLevel level, Transformer transformer, Configurator configurator, boolean copy) |
| | Run selected tests for a given target and configurator up to the specified level.
|
| void | runTestsFor (List< Target > subset, String description, Predicate< TestCategory > selected, Transformer transformer, Configurator configurator, TestLevel level, boolean copy) |
| | Run tests in the given selection for a subset of given targets.
|
| void | runTestsForTargets (String description, Predicate< TestCategory > selected, Transformer transformer, Configurator configurator, TestLevel level, boolean copy) |
| | Run tests in the given selection for all targets enabled in this class.
|
| boolean | supportsSingleThreadedExecution () |
| | Whether to enable threading.
|
| | TestBase (List< Target > targets) |
| | Special ctor for the code coverage test.
|
| | TestBase (Target first) |
| | Constructor for test classes that test a single target.
|
|
| static boolean | isLinux () |
| | Determine whether the current platform is Linux.
|
| static boolean | isMac () |
| | Determine whether the current platform is MacOS.
|
| static boolean | isWindows () |
| | Determine whether the current platform is Windows.
|
| static void | printTestHeader (Target target, String description) |
| | Print a header that describes a collection of tests.
|
Base class for test classes that define tests that parse and build LF files from the TestRegistry.
- Author
- Marten Lohstroh
◆ TestBase() [1/2]
| org.lflang.tests.TestBase.TestBase |
( |
Target | first | ) |
|
|
protected |
Constructor for test classes that test a single target.
◆ TestBase() [2/2]
| org.lflang.tests.TestBase.TestBase |
( |
List< Target > | targets | ) |
|
|
protected |
Special ctor for the code coverage test.
◆ applyDefaultConfiguration()
| void org.lflang.tests.TestBase.applyDefaultConfiguration |
( |
TargetConfig | config | ) |
|
|
protected |
◆ getExecCommand()
| ProcessBuilder org.lflang.tests.TestBase.getExecCommand |
( |
LFTest | test | ) |
throws TestError |
|
protected |
Return a preconfigured ProcessBuilder for executing the test program.
- Parameters
-
| test | The test to get the execution command for. |
Reimplemented in org.lflang.tests.runtime.CPatmosTest.
◆ getGeneratorArguments()
| GeneratorArguments org.lflang.tests.TestBase.getGeneratorArguments |
( |
| ) |
|
|
protected |
Return generator arguments suitable for testing.
◆ isLinux()
| boolean org.lflang.tests.TestBase.isLinux |
( |
| ) |
|
|
staticprotected |
Determine whether the current platform is Linux.
- Returns
- true if the current platform is Linux, false otherwise.
◆ isMac()
| boolean org.lflang.tests.TestBase.isMac |
( |
| ) |
|
|
staticprotected |
Determine whether the current platform is MacOS.
- Returns
- true if the current platform is MacOS, false otherwise.
◆ isWindows()
| boolean org.lflang.tests.TestBase.isWindows |
( |
| ) |
|
|
staticprotected |
Determine whether the current platform is Windows.
- Returns
- true if the current platform is Windwos, false otherwise.
◆ pathToLevel()
| TestLevel org.lflang.tests.TestBase.pathToLevel |
( |
Path | path | ) |
|
|
static |
Static function for converting a path to its associated test level.
- Author
- Anirudh Rengarajan
◆ printTestHeader()
| void org.lflang.tests.TestBase.printTestHeader |
( |
Target | target, |
|
|
String | description ) |
|
staticprotected |
Print a header that describes a collection of tests.
- Parameters
-
| target | The target for which the tests are being performed. |
| description | A string the describes the collection of tests. |
◆ runSingleTestAndPrintResults()
| void org.lflang.tests.TestBase.runSingleTestAndPrintResults |
( |
LFTest | test, |
|
|
Class<? extends TestBase > | testClass, |
|
|
TestLevel | level ) |
|
static |
Run a test, print results on stderr.
- Parameters
-
| test | Test case. |
| testClass | The test class that will execute the test. This is target-specific, it may provide some target-specific configuration. We pass a class and not a new instance because this method needs to ensure the object is properly injected, and so, it needs to control its entire lifecycle. |
| level | Level to which to run the test. |
◆ runTestsAndPrintResults()
Run selected tests for a given target and configurator up to the specified level.
- Parameters
-
| target | The target to run tests for. |
| selected | A predicate that given a test category returns whether it should be included in this test run or not. |
| level | The test level. |
| transformer | The transformer to apply to tests. |
| configurator | A procedure for configuring the tests. |
| copy | Whether to work on copies of tests in the test. registry. |
◆ runTestsFor()
Run tests in the given selection for a subset of given targets.
- Parameters
-
| subset | The subset of targets to run the selected tests for. |
| description | A string that describes the collection of tests. |
| selected | A predicate that given a test category returns whether it should be included in this test run or not. |
| transformer | The transformer to apply to tests. |
| configurator | A procedure for configuring the tests. |
| level | The test level. |
| copy | Whether to work on copies of tests in the test. registry. |
◆ runTestsForTargets()
Run tests in the given selection for all targets enabled in this class.
- Parameters
-
| description | A string that describes the collection of tests. |
| selected | A predicate that given a test category returns whether it should be included in this test run or not. |
| transformer | The transformer to apply to tests. |
| configurator | A procedure for configuring the tests. |
| level | The test level. |
| copy | Whether to work on copies of tests in the test. registry. |
◆ stackTraceToString()
| String org.lflang.tests.TestBase.stackTraceToString |
( |
Throwable | t | ) |
|
|
static |
◆ supportsSingleThreadedExecution()
| boolean org.lflang.tests.TestBase.supportsSingleThreadedExecution |
( |
| ) |
|
|
protected |
◆ fileAccess
| JavaIoFileSystemAccess org.lflang.tests.TestBase.fileAccess |
|
package |
◆ generator
◆ resourceSetProvider
| Provider<ResourceSet> org.lflang.tests.TestBase.resourceSetProvider |
|
package |
◆ testRegistry
◆ THICK_LINE
| final String org.lflang.tests.TestBase.THICK_LINE |
|
static |
Initial value:=
"=============================================================================="
+ System.lineSeparator()
Content separator used in test output, 78 characters wide.
◆ THIN_LINE
| final String org.lflang.tests.TestBase.THIN_LINE |
|
static |
Initial value:=
"------------------------------------------------------------------------------"
+ System.lineSeparator()
Content separator used in test output, 78 characters wide.
◆ validator
| IResourceValidator org.lflang.tests.TestBase.validator |
|
package |
The documentation for this class was generated from the following file:
- /Users/runner/work/lingua-franca/lingua-franca/core/src/testFixtures/java/org/lflang/tests/TestBase.java