-
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.
Add test group for testing from upstream (= Trixi.jl) (#7)
* Do not reexport Trixi.jl * Add Trixi as test dependency * Add function that actually exercises Trixi
- Loading branch information
Showing
4 changed files
with
26 additions
and
10 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,13 +1,10 @@ | ||
module TrixiShallowWater | ||
|
||
# import @reexport now to make it available for further imports/exports | ||
using Reexport: @reexport | ||
|
||
# Make all of Trixi.jl available to a user of this package | ||
@reexport using Trixi | ||
using Trixi: Trixi | ||
|
||
# Write your package code here. | ||
foo() = true | ||
bar() = false | ||
baz() = Trixi.examples_dir() | ||
|
||
end |
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,2 +1,6 @@ | ||
[deps] | ||
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" | ||
Trixi = "a7f1ee26-1774-49b1-8366-f1abc58fbfcb" | ||
|
||
[compat] | ||
Trixi = "0.5" |
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,7 +1,24 @@ | ||
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" | ||
@test TrixiShallowWater.foo() == true | ||
@test TrixiShallowWater.bar() == false | ||
@test TrixiShallowWater.baz() isa String | ||
end | ||
|
||
@time if TRIXI_TEST == "all" || TRIXI_TEST == "upstream" | ||
@testset "baz()" begin | ||
@test TrixiShallowWater.baz() isa String | ||
end | ||
end | ||
end |