Skip to content

Commit

Permalink
Add Trixi as test dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
sloede committed Nov 5, 2023
1 parent fb61df8 commit 347bb5d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
4 changes: 4 additions & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
[deps]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Trixi = "a7f1ee26-1774-49b1-8366-f1abc58fbfcb"

[compat]
Trixi = "0.5"
21 changes: 18 additions & 3 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
using TrixiShallowWater
using Test

@testset "TrixiShallowWater.jl" begin
@test TrixiShallowWater.foo() == true
@test TrixiShallowWater.bar() == false
# We run tests in parallel with CI jobs setting the `TRIXI_TEST` environment
# variable to determine the subset of tests to execute.
# By default, we just run the threaded tests since they are relatively cheap
# and test a good amount of different functionality.
const TRIXI_TEST = get(ENV, "TRIXI_TEST", "all")
const TRIXI_MPI_NPROCS = clamp(Sys.CPU_THREADS, 2, 3)
const TRIXI_NTHREADS = clamp(Sys.CPU_THREADS, 2, 3)

@time @testset "TrixiShallowWater.jl tests" begin
@time if TRIXI_TEST == "all" || TRIXI_TEST == "mpi"
@test TrixiShallowWater.foo() == true
@test TrixiShallowWater.bar() == false
end

@time if TRIXI_TEST == "all" || TRIXI_TEST == "upstream"
@test TrixiShallowWater.foo() == true
@test TrixiShallowWater.bar() == false
end
end

0 comments on commit 347bb5d

Please sign in to comment.