Skip to content

Commit

Permalink
Include linux runner (JKRT#44)
Browse files Browse the repository at this point in the history
* Fixed __init__ on Linux

* Updated the init file for Linux.

* Removed nonworking tests for Linux

* Enable some of the tests on Linux
  • Loading branch information
JKRT authored Dec 1, 2021
1 parent b2f73db commit 4cd9d4f
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 15 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/blank.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,36 @@ jobs:
- uses: codecov/codecov-action@v1
with:
file: lcov.info
test2:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- '1.6'
os:
- ubuntu-latest
arch:
- x64
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: actions/cache@v1
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- run: julia --compiled-modules=no --color=yes --project -e 'import Pkg; Pkg.Registry.add("General"); Pkg.Registry.add(Pkg.RegistrySpec(url="https://github.com/JKRT/OpenModelicaRegistry.git")); Pkg.build(;verbose = true);'
- uses: julia-actions/julia-runtest@v1
- uses: codecov/codecov-action@v1
with:
file: lcov.info
8 changes: 4 additions & 4 deletions src/OMFrontend.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ const NFModelicaBuiltinCache = Dict()
function __init__()
if ! haskey(NFModelicaBuiltinCache, "NFModelicaBuiltin")
#= Locate the external libraries =#
packagePath = realpath(Base.find_package("OMFrontend") * "../../..")
path = realpath(packagePath)
path *= "/lib/NFModelicaBuiltin.mo"
packagePath = dirname(realpath(Base.find_package("OMFrontend")))
packagePath *= "/.."
pathToLib = packagePath * "/lib/NFModelicaBuiltin.mo"
#= The external C stuff can be a bit flaky.. =#
GC.enable(false)
p = parseFile(path, 2 #== MetaModelica ==#)
p = parseFile(pathToLib, 2 #== MetaModelica ==#)
@debug "SCode translation"
s = OMFrontend.translateToSCode(p)
NFModelicaBuiltinCache["NFModelicaBuiltin"] = s
Expand Down
24 changes: 13 additions & 11 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,19 @@ function flattenFM(model, file)
end

#= Actualy tests =#

@testset "Frontend sanitiy tests. Check if we can transform the abstract tree to SCode and that we are able to flatten without exceptions" begin
@testset "Absyn -> SCode test" begin
include("scodeSanityTest.jl")
end

@testset "SCode -> DAE Sanity test" begin
include("daeTests.jl")
@testset "Frontend sanitiy tests. Check if we can transform the abstract tree to SCode and that we are able to flatten without exceptions" begin
@testset "Absyn -> SCode test" begin
include("scodeSanityTest.jl")
end
@testset "SCode -> DAE Sanity test" begin
include("daeTests.jl")
end
end
end

@testset "Frontend Validation test. Check that the result corresponds to existing models in the original frontend " begin
if Sys.iswindows()
@testset "Frontend Validation test. Check that the result corresponds to existing models in the original frontend " begin
include("frontendResultTest.jl")
end
else
@info "Due to issues with the parser only windows is supported at the moment"
end

0 comments on commit 4cd9d4f

Please sign in to comment.