From b85b7c2add479ec20a03b4fa7bf248e6994f981a Mon Sep 17 00:00:00 2001 From: jClugstor Date: Fri, 28 Jun 2024 15:04:02 -0400 Subject: [PATCH] test groups --- .github/workflows/Tests.yml | 7 ++++++ test/runtests.jl | 44 +++++++++++++++++++++---------------- 2 files changed, 32 insertions(+), 19 deletions(-) diff --git a/.github/workflows/Tests.yml b/.github/workflows/Tests.yml index a625cd9..fe6dc83 100644 --- a/.github/workflows/Tests.yml +++ b/.github/workflows/Tests.yml @@ -23,3 +23,10 @@ jobs: name: "Tests" uses: "SciML/.github/.github/workflows/tests.yml@v1" secrets: "inherit" + strategy: + matrix: + group: + - Core + - Quality + version: + - '1' diff --git a/test/runtests.jl b/test/runtests.jl index 75b35dc..8c6e35f 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -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 \ No newline at end of file