Skip to content

Commit

Permalink
Fix model_parsing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
YingboMa committed Jan 4, 2024
1 parent 089649e commit e763b63
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 4 additions & 1 deletion test/model_parsing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"))

Expand All @@ -340,6 +342,7 @@ end

pop!(LOAD_PATH)
end
end

@testset "Conditional statements inside the blocks" begin
@mtkmodel C begin end
Expand Down
3 changes: 1 addition & 2 deletions test/precompile_test/ModelParsingPrecompile.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
module ModelParsingPrecompile

using ModelingToolkit
using Unitful
using ModelingToolkit, Unitful

@mtkmodel ModelWithComponentArray begin
@parameters begin
Expand Down

0 comments on commit e763b63

Please sign in to comment.