-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
32 additions
and
19 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
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 |