forked from lf-lang/lingua-franca
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support C federated tests with Rust RTI
- Most of C tests except federated tests are removed.
- Loading branch information
1 parent
2f0d82a
commit 58d55fd
Showing
20 changed files
with
1,025 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: C tests | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
compiler-ref: | ||
required: false | ||
type: string | ||
runtime-ref: | ||
required: false | ||
type: string | ||
use-cpp: | ||
required: false | ||
type: boolean | ||
default: false | ||
scheduler: | ||
required: false | ||
type: string | ||
all-platforms: | ||
required: false | ||
default: true | ||
type: boolean | ||
|
||
jobs: | ||
regular-tests: | ||
strategy: | ||
matrix: | ||
platform: ${{ (inputs.all-platforms && fromJSON('["ubuntu-latest"]')) || fromJSON('["ubuntu-latest"]') }} | ||
runs-on: ${{ matrix.platform }} | ||
timeout-minutes: 120 | ||
steps: | ||
- name: Check out lingua-franca repository | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: chanijjani/lingua-franca | ||
submodules: true | ||
ref: ${{ inputs.compiler-ref }} | ||
fetch-depth: 0 | ||
- name: Prepare build environment | ||
uses: ./.github/actions/prepare-build-env | ||
- name: Perform federated tests for C target with Rust RTI and default scheduler | ||
run: ./gradlew targetTest -Ptarget=RustRti | ||
if: ${{ !inputs.use-cpp && !inputs.scheduler }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
191 changes: 191 additions & 0 deletions
191
core/src/integrationTest/java/org/lflang/tests/SimplifiedRuntimeTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,191 @@ | ||
package org.lflang.tests; | ||
|
||
import java.nio.file.Path; | ||
import java.util.EnumSet; | ||
import java.util.List; | ||
import org.junit.jupiter.api.Assumptions; | ||
import org.junit.jupiter.api.Test; | ||
import org.lflang.ast.ASTUtils; | ||
import org.lflang.target.Target; | ||
import org.lflang.tests.TestRegistry.TestCategory; | ||
|
||
/** | ||
* A collection of JUnit tests to perform on a given set of targets. | ||
* | ||
* @author Marten Lohstroh | ||
*/ | ||
public abstract class SimplifiedRuntimeTest extends TestBase { | ||
|
||
/** | ||
* Construct a test instance that runs tests for a single target. | ||
* | ||
* @param target The target to run tests for. | ||
*/ | ||
protected SimplifiedRuntimeTest(Target target) { | ||
super(target); | ||
} | ||
|
||
/** | ||
* Construct a test instance that runs tests for a list of targets. | ||
* | ||
* @param targets The targets to run tests for. | ||
*/ | ||
protected SimplifiedRuntimeTest(List<Target> targets) { | ||
super(targets); | ||
} | ||
|
||
/** Whether to enable {@link #runEnclaveTests()}. */ | ||
protected boolean supportsEnclaves() { | ||
return false; | ||
} | ||
|
||
/** Whether to enable {@link #runFederatedTests()}. */ | ||
protected boolean supportsFederatedExecution() { | ||
return false; | ||
} | ||
|
||
/** Whether to enable {@link #runGenericsTests()}. */ | ||
protected boolean supportsGenericTypes() { | ||
return false; | ||
} | ||
|
||
/** Whether to enable {@link #runDockerTests()} and {@link #runDockerFederatedTests()}. */ | ||
protected boolean supportsDockerOption() { | ||
return false; | ||
} | ||
|
||
// @Test | ||
// public void runBasicTests() { | ||
// runTestsForTargets( | ||
// Message.DESC_BASIC, | ||
// TestCategory.BASIC::equals, | ||
// Transformers::noChanges, | ||
// Configurators::noChanges, | ||
// TestLevel.EXECUTION, | ||
// false); | ||
// } | ||
|
||
// @Test | ||
// public void runGenericsTests() { | ||
// runTestsForTargets( | ||
// Message.DESC_GENERICS, | ||
// TestCategory.GENERICS::equals, | ||
// Transformers::noChanges, | ||
// Configurators::noChanges, | ||
// TestLevel.EXECUTION, | ||
// false); | ||
// } | ||
|
||
// @Test | ||
// public void runTargetSpecificTests() { | ||
// runTestsForTargets( | ||
// Message.DESC_TARGET_SPECIFIC, | ||
// TestCategory.TARGET::equals, | ||
// Transformers::noChanges, | ||
// Configurators::noChanges, | ||
// TestLevel.EXECUTION, | ||
// false); | ||
// } | ||
|
||
// @Test | ||
// public void runMultiportTests() { | ||
// runTestsForTargets( | ||
// Message.DESC_MULTIPORT, | ||
// TestCategory.MULTIPORT::equals, | ||
// Transformers::noChanges, | ||
// Configurators::noChanges, | ||
// TestLevel.EXECUTION, | ||
// false); | ||
// } | ||
|
||
// @Test | ||
// public void runFederatedTests() {} | ||
|
||
@Test | ||
// public void runFederatedTestsWithRustRti(Path rustRtiProjectPath) { | ||
public void runFederatedTestsWithRustRti() { | ||
Assumptions.assumeTrue(supportsFederatedExecution(), Message.NO_FEDERATION_SUPPORT); | ||
runTestsForTargetsWithRustRti( | ||
Message.DESC_FEDERATED_WITH_RUST_RTI, | ||
TestCategory.FEDERATED::equals, | ||
Transformers::noChanges, | ||
Configurators::noChanges, | ||
TestLevel.EXECUTION, | ||
// false, | ||
// rustRtiProjectPath); | ||
false); | ||
} | ||
|
||
/** Run the tests for modal reactors. */ | ||
// @Test | ||
// public void runModalTests() { | ||
// runTestsForTargets( | ||
// Message.DESC_MODAL, | ||
// TestCategory.MODAL_MODELS::equals, | ||
// Transformers::noChanges, | ||
// Configurators::noChanges, | ||
// TestLevel.EXECUTION, | ||
// false); | ||
// } | ||
|
||
/** Run the tests for non-inlined reaction bodies. */ | ||
// @Test | ||
// public void runNoInliningTests() { | ||
// runTestsForTargets( | ||
// Message.DESC_MODAL, | ||
// TestCategory.NO_INLINING::equals, | ||
// Transformers::noChanges, | ||
// Configurators::noChanges, | ||
// TestLevel.EXECUTION, | ||
// false); | ||
// } | ||
|
||
// @Test | ||
// public void runWithThreadingOff() { | ||
// Assumptions.assumeTrue(supportsSingleThreadedExecution(), Message.NO_SINGLE_THREADED_SUPPORT); | ||
// this.runTestsForTargets( | ||
// Message.DESC_SINGLE_THREADED, | ||
// RuntimeTest::compatibleWithThreadingOff, | ||
// Transformers::noChanges, | ||
// Configurators::disableThreading, | ||
// TestLevel.EXECUTION, | ||
// true); | ||
// } | ||
|
||
/** Run enclave tests if the target supports enclaves. */ | ||
// @Test | ||
// public void runEnclaveTests() { | ||
// Assumptions.assumeTrue(supportsEnclaves(), Message.NO_ENCLAVE_SUPPORT); | ||
// runTestsForTargets( | ||
// Message.DESC_ENCLAVE, | ||
// TestCategory.ENCLAVE::equals, | ||
// Transformers::noChanges, | ||
// Configurators::noChanges, | ||
// TestLevel.EXECUTION, | ||
// false); | ||
// } | ||
|
||
/** Given a test category, return true if it is compatible with single-threaded execution. */ | ||
public static boolean compatibleWithThreadingOff(TestCategory category) { | ||
|
||
// CONCURRENT, FEDERATED, DOCKER_FEDERATED, DOCKER | ||
// are not compatible with single-threaded execution. | ||
// ARDUINO and ZEPHYR have their own test suites, so we don't need to rerun. | ||
boolean excluded = | ||
category == TestCategory.CONCURRENT | ||
|| category == TestCategory.SERIALIZATION | ||
|| category == TestCategory.FEDERATED | ||
|| category == TestCategory.DOCKER_FEDERATED | ||
|| category == TestCategory.DOCKER | ||
|| category == TestCategory.ENCLAVE | ||
|| category == TestCategory.ARDUINO | ||
|| category == TestCategory.VERIFIER | ||
|| category == TestCategory.ZEPHYR_UNTHREADED | ||
|| category == TestCategory.ZEPHYR_BOARDS | ||
|| category == TestCategory.ZEPHYR_THREADED; | ||
|
||
// SERIALIZATION and TARGET tests are excluded on Windows. | ||
excluded |= isWindows() && category == TestCategory.TARGET; | ||
return !excluded; | ||
} | ||
} |
Oops, something went wrong.