-
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.
Merge pull request #1271 from lf-lang/verifier
Uclid5-based LF Verifier
- Loading branch information
Showing
64 changed files
with
8,139 additions
and
103 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,73 @@ | ||
name: Uclid5-based Verifier Tests | ||
|
||
on: | ||
# Trigger this workflow also on workflow_call events. | ||
workflow_call: | ||
inputs: | ||
compiler-ref: | ||
required: false | ||
type: string | ||
runtime-ref: | ||
required: false | ||
type: string | ||
|
||
jobs: | ||
run: | ||
strategy: | ||
matrix: | ||
platform: [ubuntu-latest] | ||
runs-on: ${{ matrix.platform }} | ||
steps: | ||
- name: Check out lingua-franca repository | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: lf-lang/lingua-franca | ||
submodules: true | ||
ref: ${{ inputs.compiler-ref }} | ||
fetch-depth: 0 | ||
- name: Prepare build environment | ||
uses: ./.github/actions/prepare-build-env | ||
- name: Check out specific ref of reactor-c | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: lf-lang/reactor-c | ||
path: core/src/main/resources/lib/c/reactor-c | ||
ref: ${{ inputs.runtime-ref }} | ||
if: ${{ inputs.runtime-ref }} | ||
- name: Check out Uclid5 repository | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: uclid-org/uclid | ||
ref: 4fd5e566c5f87b052f92e9b23723a85e1c4d8c1c | ||
path: uclid | ||
- name: Download Z3 | ||
working-directory: uclid/ | ||
if: steps.cache-z3.outputs.cache-hit != 'true' | ||
run: ./get-z3-linux.sh | ||
- name: Add Z3 to Path | ||
working-directory: uclid/ | ||
run: | | ||
echo "$(pwd)/z3/bin/" >> $GITHUB_PATH | ||
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)/z3/bin/" >> $GITHUB_ENV | ||
- name: Print Z3 Version | ||
run: z3 --version | ||
- name: Install Uclid5 | ||
working-directory: uclid/ | ||
run: | | ||
sbt update clean compile | ||
sbt universal:packageBin | ||
cd target/universal/ | ||
unzip uclid-0.9.5.zip | ||
./uclid-0.9.5/bin/uclid --help | ||
echo "$(pwd)/uclid-0.9.5/bin" >> $GITHUB_PATH | ||
cd ../.. | ||
- name: Run verifier tests | ||
run: | | ||
echo "$pwd" | ||
ls -la | ||
./gradlew core:integrationTest --tests org.lflang.tests.runtime.CVerifierTest.* core:integrationTestCodeCoverageReport | ||
- name: Report to CodeCov | ||
uses: ./.github/actions/report-code-coverage | ||
with: | ||
files: core/build/reports/jacoco/integrationTestCodeCoverageReport/integrationTestCodeCoverageReport.xml | ||
if: ${{ github.repository == 'lf-lang/lingua-franca' }} |
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
16 changes: 16 additions & 0 deletions
16
buildSrc/src/main/groovy/org.lflang.antlr-conventions.gradle
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,16 @@ | ||
plugins { | ||
id 'antlr' | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
antlr "org.antlr:antlr4:${antlrVersion}" | ||
} | ||
|
||
if (project.tasks.findByName('compileKotlin')) { | ||
// make all kotlin compile tasks dependent on the antl generation tasks | ||
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).each(it -> it.dependsOn(tasks.withType(AntlrTask))) | ||
} |
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
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
30 changes: 30 additions & 0 deletions
30
core/src/integrationTest/java/org/lflang/tests/runtime/CVerifierTest.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,30 @@ | ||
package org.lflang.tests.runtime; | ||
|
||
import java.util.List; | ||
import org.junit.jupiter.api.Assumptions; | ||
import org.junit.jupiter.api.Test; | ||
import org.lflang.Target; | ||
import org.lflang.tests.TestBase; | ||
import org.lflang.tests.TestRegistry; | ||
|
||
public class CVerifierTest extends TestBase { | ||
protected CVerifierTest() { | ||
super(Target.C); | ||
} | ||
|
||
@Test | ||
public void runVerifierTests() { | ||
Assumptions.assumeTrue(isLinux() || isMac(), "Verifier tests only run on Linux or macOS"); | ||
|
||
super.runTestsFor( | ||
List.of(Target.C), | ||
Message.DESC_VERIFIER, | ||
TestRegistry.TestCategory.VERIFIER::equals, | ||
test -> { | ||
test.getContext().getTargetConfig().verify = true; | ||
return true; | ||
}, | ||
TestLevel.BUILD, | ||
false); | ||
} | ||
} |
Oops, something went wrong.