-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update CI to regularly test examples
- Loading branch information
Showing
3 changed files
with
48 additions
and
4 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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
module TestExamples | ||
|
||
using Test | ||
using GenX | ||
|
||
include(joinpath(@__DIR__, "utilities.jl")) | ||
|
||
|
||
# Test that the examples in the example_systems directory run without error | ||
function test_examples() | ||
base_path = Base.dirname(Base.dirname(pathof(GenX))) | ||
examples_path = joinpath(base_path, "example_systems") | ||
|
||
examples_dir = readdir(examples_path, join=true) | ||
for example_dir in examples_dir | ||
if isdir(example_dir) && isfile(joinpath(example_dir, "Run.jl")) | ||
@info "Running example in $example_dir" | ||
result = @warn_error_logger run_genx_case!(example_dir) | ||
@test isnothing(result) | ||
end | ||
end | ||
end | ||
|
||
@testset "Test examples" begin | ||
test_examples() | ||
end | ||
|
||
end # module |
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