Skip to content

Commit

Permalink
test groups
Browse files Browse the repository at this point in the history
  • Loading branch information
jClugstor committed Jun 28, 2024
1 parent b663aec commit b85b7c2
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 19 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/Tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,10 @@ jobs:
name: "Tests"
uses: "SciML/.github/.github/workflows/tests.yml@v1"
secrets: "inherit"
strategy:
matrix:
group:
- Core
- Quality
version:
- '1'
44 changes: 25 additions & 19 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,26 +1,32 @@
using Test, SafeTestsets

@testset "Quality Assurance" begin
@safetestset "Quality Assurance" include("qa.jl")
const GROUP = get(ENV,"GROUP", "All")

if GROUP == "All" || GROUP == "Quality"
@testset "Quality Assurance" begin
@safetestset "Quality Assurance" include("qa.jl")
end
end

@testset "BaseModelica" begin
@safetestset "Parsing and Conversion Tests" begin
using BaseModelica
using ModelingToolkit
BM = BaseModelica
PC = BM.ParserCombinator
if GROUP == "All" || GROUP == "Core"
@testset "BaseModelica" begin
@safetestset "Parsing and Conversion Tests" begin
using BaseModelica
using ModelingToolkit
BM = BaseModelica
PC = BM.ParserCombinator

arith_test = only(PC.parse_one("5 + 6*(45 + 9^2)^2", BM.arithmetic_expression))
@test arith_test isa BM.BaseModelicaSum
@test BM.eval_AST(arith_test) == 95261.0
arith_test = only(PC.parse_one("5 + 6*(45 + 9^2)^2", BM.arithmetic_expression))
@test arith_test isa BM.BaseModelicaSum
@test BM.eval_AST(arith_test) == 95261.0

newton_path = joinpath(
dirname(dirname(pathof(BM))), "test", "testfiles", "NewtonCoolingBase.mo")
newton_cooling = BM.parse_file(newton_path)
@test newton_cooling isa BM.BaseModelicaPackage
newton_system = BM.baseModelica_to_ModelingToolkit(newton_cooling)
@test newton_system isa ODESystem
@test parse_basemodelica("testfiles/NewtonCoolingBase.mo") isa ODESystem
newton_path = joinpath(
dirname(dirname(pathof(BM))), "test", "testfiles", "NewtonCoolingBase.mo")
newton_cooling = BM.parse_file(newton_path)
@test newton_cooling isa BM.BaseModelicaPackage
newton_system = BM.baseModelica_to_ModelingToolkit(newton_cooling)
@test newton_system isa ODESystem
@test parse_basemodelica("testfiles/NewtonCoolingBase.mo") isa ODESystem
end
end
end
end

0 comments on commit b85b7c2

Please sign in to comment.