-
-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enabled C federated tests with Rust RTI
- At first, thirty-five C federated tests are evaluated with Rust RTI
- Loading branch information
1 parent
150cf6a
commit 33b6d62
Showing
60 changed files
with
2,595 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: C tests with Rust RTI | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
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: 30 | ||
|
||
steps: | ||
- name: Check out lingua-franca repository | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: lf-lang/lingua-franca | ||
submodules: true | ||
fetch-depth: 0 | ||
- name: Prepare build environment | ||
uses: ./.github/actions/prepare-build-env | ||
- name: Perform federated tests for C target with Rust RTI | ||
# TODO: Drop "git checkout" after this PR is merged. | ||
run: git checkout rust-rti-test; ./gradlew targetTest -Ptarget=RustRti |
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
41 changes: 41 additions & 0 deletions
41
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,41 @@ | ||
package org.lflang.tests; | ||
|
||
import org.junit.jupiter.api.Assumptions; | ||
import org.junit.jupiter.api.Test; | ||
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 | ||
* @author Chanhee Lee | ||
*/ | ||
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); | ||
} | ||
|
||
/** Whether to enable {@link #runFederatedTests()}. */ | ||
protected boolean supportsFederatedExecution() { | ||
return false; | ||
} | ||
|
||
@Test | ||
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); | ||
} | ||
} |
62 changes: 62 additions & 0 deletions
62
core/src/integrationTest/java/org/lflang/tests/runtime/RustRtiTest.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,62 @@ | ||
/************* | ||
* Copyright (c) 2019-2024, The University of California at Berkeley. | ||
* | ||
* Redistribution and use in source and binary forms, with or without modification, | ||
* are permitted provided that the following conditions are met: | ||
* | ||
* 1. Redistributions of source code must retain the above copyright notice, | ||
* this list of conditions and the following disclaimer. | ||
* | ||
* 2. Redistributions in binary form must reproduce the above copyright notice, | ||
* this list of conditions and the following disclaimer in the documentation | ||
* and/or other materials provided with the distribution. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR | ||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
***************/ | ||
package org.lflang.tests.runtime; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.lflang.target.Target; | ||
import org.lflang.tests.SimplifiedRuntimeTest; | ||
|
||
/** | ||
* Collection of tests for the C target with Rust RTI. | ||
* | ||
* <p>Tests that are implemented in the base class are still overridden so that each test can be | ||
* easily invoked individually from IDEs with JUnit support like Eclipse and IntelliJ. This is | ||
* typically done by right-clicking on the name of the test method and then clicking "Run".* | ||
* | ||
* @author Marten Lohstroh | ||
* @author Chanhee Lee | ||
*/ | ||
public class RustRtiTest extends SimplifiedRuntimeTest { | ||
|
||
public RustRtiTest() { | ||
super(Target.RustRti); | ||
} | ||
|
||
@Override | ||
protected boolean supportsSingleThreadedExecution() { | ||
return true; | ||
} | ||
|
||
@Override | ||
protected boolean supportsFederatedExecution() { | ||
return true; | ||
} | ||
|
||
@Test | ||
@Override | ||
public void runFederatedTestsWithRustRti() { | ||
super.runFederatedTestsWithRustRti(); | ||
} | ||
} |
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
Oops, something went wrong.