From e763b63711e411af5013c203635b0a5a6c56d284 Mon Sep 17 00:00:00 2001 From: Yingbo Ma Date: Wed, 3 Jan 2024 22:55:09 -0500 Subject: [PATCH] Fix model_parsing tests --- test/model_parsing.jl | 5 ++++- test/precompile_test/ModelParsingPrecompile.jl | 3 +-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/test/model_parsing.jl b/test/model_parsing.jl index b8a9d0b036..f94d7483fd 100644 --- a/test/model_parsing.jl +++ b/test/model_parsing.jl @@ -9,7 +9,7 @@ ENV["MTK_ICONS_DIR"] = "$(@__DIR__)/icons" # Mock module used to test if the `@mtkmodel` macro works with fully-qualified names as well. module MyMockModule -using ..ModelingToolkit, ..Unitful +using ModelingToolkit, DynamicQuantities export Pin @connector Pin begin @@ -328,6 +328,8 @@ end # Ensure that modules consisting MTKModels with component arrays and icons of # `Expr` type and `unit` metadata can be precompiled. +module PrecompilationTest +using Unitful, Test, ModelingToolkit @testset "Precompile packages with MTKModels" begin push!(LOAD_PATH, joinpath(@__DIR__, "precompile_test")) @@ -340,6 +342,7 @@ end pop!(LOAD_PATH) end +end @testset "Conditional statements inside the blocks" begin @mtkmodel C begin end diff --git a/test/precompile_test/ModelParsingPrecompile.jl b/test/precompile_test/ModelParsingPrecompile.jl index 8430831b55..ed67dd8a0c 100644 --- a/test/precompile_test/ModelParsingPrecompile.jl +++ b/test/precompile_test/ModelParsingPrecompile.jl @@ -1,7 +1,6 @@ module ModelParsingPrecompile -using ModelingToolkit -using Unitful +using ModelingToolkit, Unitful @mtkmodel ModelWithComponentArray begin @parameters begin