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
- Loading branch information
1 parent
2f0d82a
commit 31d5906
Showing
12 changed files
with
685 additions
and
88 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,48 @@ | ||
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", "macos-latest", "windows-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 tests for C target with default scheduler | ||
run: ./gradlew targetTest -Ptarget=C | ||
if: ${{ !inputs.use-cpp && !inputs.scheduler }} | ||
- name: Perform tests for C target with specified scheduler (no LSP tests) | ||
run: | | ||
echo "Specified scheduler: ${{ inputs.scheduler }}" | ||
./gradlew targetTest -Ptarget=C -Dscheduler=${{ inputs.scheduler }} | ||
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
104 changes: 104 additions & 0 deletions
104
core/src/integrationTest/java/org/lflang/tests/runtime/RustRtiCTest.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,104 @@ | ||
/************* | ||
* Copyright (c) 2019, 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 java.nio.file.Path; | ||
|
||
import org.junit.jupiter.api.Assumptions; | ||
import org.junit.jupiter.api.Disabled; | ||
import org.junit.jupiter.api.Test; | ||
import org.lflang.target.Target; | ||
import org.lflang.tests.RuntimeTest; | ||
|
||
/** | ||
* Collection of tests for the C target. | ||
* | ||
* <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 RustRtiCTest extends RuntimeTest { | ||
|
||
public RustRtiCTest() { | ||
super(Target.C); | ||
} | ||
|
||
@Override | ||
protected boolean supportsSingleThreadedExecution() { | ||
return true; | ||
} | ||
|
||
@Override | ||
protected boolean supportsFederatedExecution() { | ||
return true; | ||
} | ||
|
||
@Override | ||
protected boolean supportsDockerOption() { | ||
return true; | ||
} | ||
|
||
@Test | ||
@Override | ||
public void runBasicTests() { | ||
super.runBasicTests(); | ||
} | ||
|
||
@Test | ||
@Override | ||
public void runGenericsTests() { | ||
super.runGenericsTests(); | ||
} | ||
|
||
@Test | ||
@Override | ||
public void runTargetSpecificTests() { | ||
Assumptions.assumeFalse(isWindows(), Message.NO_WINDOWS_SUPPORT); | ||
super.runTargetSpecificTests(); | ||
} | ||
|
||
@Test | ||
@Override | ||
public void runMultiportTests() { | ||
super.runMultiportTests(); | ||
} | ||
|
||
@Test | ||
@Override | ||
public void runWithThreadingOff() { | ||
super.runWithThreadingOff(); | ||
} | ||
|
||
@Test | ||
// public void runFederatedTests(Path rustRtiProjectPath) { | ||
public void runFederatedTests() { | ||
Assumptions.assumeFalse(isWindows(), Message.NO_WINDOWS_SUPPORT); | ||
// super.runFederatedTestsWithRustRti(rustRtiProjectPath); | ||
super.runFederatedTestsWithRustRti(); | ||
} | ||
} |
Oops, something went wrong.