![]() |
lingua-franca 0.10.1
Lingua Franca code generator
|
Integration tests for command-line parameter override functionality. More...
Inherits org.lflang.tests.TestBase.
Public Member Functions | |
| CCliTest () | |
| void | testCommandLineActionOverride () |
| Test that –min_delay and –min_spacing override action timing. | |
| void | testCommandLineDeadlineFederatedOverride () |
| Test that CLI overrides propagate through the launch script in federated execution. | |
| void | testCommandLineDeadlineOverride () |
| Test that –deadline_time and –execution_time override deadline behavior. | |
| void | testCommandLineParameterOverride () |
| Test that –period, –expected, and –value override timer behavior and double parameter. | |
| void | testCommandLineStringBoolOverride () |
| Test that –value and –use_default override string and bool parameters. | |
Static Public Member Functions | |
| static TestLevel | pathToLevel (Path path) |
| Static function for converting a path to its associated test level. | |
| static void | runSingleTestAndPrintResults (LFTest test, Class<? extends TestBase > testClass, TestLevel level) |
| Run a test, print results on stderr. | |
| static String | stackTraceToString (Throwable t) |
Static Public Attributes | |
| 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. | |
Protected Member Functions | |
| 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. | |
Static Protected Member Functions | |
| 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. | |
Package Functions | |
| void | resetCliArgs () |
Package Attributes | |
| JavaIoFileSystemAccess | fileAccess |
| LFGenerator | generator |
| Provider< ResourceSet > | resourceSetProvider |
| TestRegistry | testRegistry |
| IResourceValidator | validator |
Integration tests for command-line parameter override functionality.
Verifies that main reactor parameters can be overridden via command-line arguments and that the overridden values propagate correctly to child reactors, including timers and deadlines.
Uses a ThreadLocal so that the CLI arguments set in each test method are visible to the runner instance created reflectively by TestBase#runSingleTestAndPrintResults, which executes on the same thread. This is safe for concurrent test execution.
| org.lflang.tests.runtime.CCliTest.CCliTest | ( | ) |
|
protectedinherited |
Adjust target configuration for all runs of this test class.
Reimplemented in org.lflang.tests.runtime.PythonTest, and org.lflang.tests.serialization.SerializationTest.
|
protected |
Return a preconfigured ProcessBuilder for executing the test program.
| test | The test to get the execution command for. |
Reimplemented from org.lflang.tests.TestBase.
|
protectedinherited |
Return generator arguments suitable for testing.
|
staticprotectedinherited |
Determine whether the current platform is Linux.
|
staticprotectedinherited |
Determine whether the current platform is MacOS.
|
staticprotectedinherited |
Determine whether the current platform is Windows.
|
staticinherited |
Static function for converting a path to its associated test level.
|
staticprotectedinherited |
Print a header that describes a collection of tests.
| target | The target for which the tests are being performed. |
| description | A string the describes the collection of tests. |
|
package |
|
staticinherited |
Run a test, print results on stderr.
| 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. |
|
protectedinherited |
Run selected tests for a given target and configurator up to the specified level.
| 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. |
|
protectedinherited |
Run tests in the given selection for a subset of given targets.
| 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. |
|
protectedinherited |
Run tests in the given selection for all targets enabled in this class.
| 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. |
|
staticinherited |
|
protectedinherited |
Whether to enable threading.
Reimplemented in org.lflang.tests.runtime.CTest, and org.lflang.tests.runtime.PythonTest.
| void org.lflang.tests.runtime.CCliTest.testCommandLineActionOverride | ( | ) |
Test that –min_delay and –min_spacing override action timing.
With defaults (min_delay=1ns, min_spacing=10ns), overriding to min_delay=10us and min_spacing=100us changes when the action fires. The test verifies that elapsed times match the overridden values.
| void org.lflang.tests.runtime.CCliTest.testCommandLineDeadlineFederatedOverride | ( | ) |
Test that CLI overrides propagate through the launch script in federated execution.
With defaults (execution_time=100ms, deadline_time=50ms) a deadline violation occurs. The CLI override sets execution_time=10ms and deadline_time=500ms with expect_violation=0, so NO violation occurs, proving the launch script forwards arguments to federates.
| void org.lflang.tests.runtime.CCliTest.testCommandLineDeadlineOverride | ( | ) |
Test that –deadline_time and –execution_time override deadline behavior.
With defaults (execution_time=100ms, deadline_time=50ms) a deadline violation occurs. The CLI override sets execution_time=10ms and deadline_time=200ms, so NO violation occurs, proving both overrides took effect.
| void org.lflang.tests.runtime.CCliTest.testCommandLineParameterOverride | ( | ) |
Test that –period, –expected, and –value override timer behavior and double parameter.
With defaults (period=1s, expected=6, value=3.14159), overriding to period=500ms changes the firing count to 11, and overriding value=2.71828 changes the double sent on each output.
| void org.lflang.tests.runtime.CCliTest.testCommandLineStringBoolOverride | ( | ) |
Test that –value and –use_default override string and bool parameters.
With default use_default=false and value="Hello, world!", overriding value to "Goodbye!" should cause the Print reactor to expect "Goodbye!". Running with –use_default true should ignore the value parameter and use the hardcoded default.
|
packageinherited |
|
packageinherited |
|
packageinherited |
|
packageinherited |
|
staticinherited |
Content separator used in test output, 78 characters wide.
|
staticinherited |
Content separator used in test output, 78 characters wide.
|
packageinherited |