|
| 1 | +using Test |
| 2 | + |
| 3 | +@testset "Sublibrary group environment precedence" begin |
| 4 | + runners = Dict( |
| 5 | + joinpath(@__DIR__, "..", "..", "lib", "DiffEqBase", "test", "runtests.jl") => "Core", |
| 6 | + joinpath(@__DIR__, "..", "..", "lib", "DiffEqDevTools", "test", "runtests.jl") => "ALL", |
| 7 | + joinpath(@__DIR__, "..", "..", "lib", "DelayDiffEq", "test", "runtests.jl") => "ALL", |
| 8 | + joinpath(@__DIR__, "..", "..", "lib", "StochasticDiffEq", "test", "runtests.jl") => "ALL", |
| 9 | + ) |
| 10 | + |
| 11 | + for (runner, default) in runners |
| 12 | + assignment = match(r"const TEST_GROUP = ([^\n]+)", read(runner, String)) |
| 13 | + @test assignment !== nothing |
| 14 | + selector = Meta.parse(only(assignment.captures)) |
| 15 | + |
| 16 | + withenv("ODEDIFFEQ_TEST_GROUP" => nothing, "GROUP" => "Requested") do |
| 17 | + @test Core.eval(@__MODULE__, selector) == "Requested" |
| 18 | + end |
| 19 | + withenv("ODEDIFFEQ_TEST_GROUP" => "Specific", "GROUP" => "Requested") do |
| 20 | + @test Core.eval(@__MODULE__, selector) == "Specific" |
| 21 | + end |
| 22 | + withenv("ODEDIFFEQ_TEST_GROUP" => nothing, "GROUP" => nothing) do |
| 23 | + @test Core.eval(@__MODULE__, selector) == default |
| 24 | + end |
| 25 | + end |
| 26 | +end |
0 commit comments