Skip to content

Commit

Permalink
compat_default_testset
Browse files Browse the repository at this point in the history
  • Loading branch information
wookay committed May 21, 2022
1 parent 2bc5068 commit eb44872
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 18 deletions.
16 changes: 15 additions & 1 deletion src/runtests_testset.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@

using .Test: AbstractTestSet, DefaultTestSet

function compat_default_testset(args...; kwargs...)::DefaultTestSet
if VERSION < v"1.9.0-DEV.623"
ignore_keys = Vector{Symbol}()
push!(ignore_keys, :failfast)
if VERSION < v"1.6.0-DEV.1437"
push!(ignore_keys, :verbose)
end
filtered_kwargs = filter(kv -> !(first(kv) in ignore_keys), kwargs)
DefaultTestSet(args...; filtered_kwargs...)
else
DefaultTestSet(args...; kwargs...)
end
end

mutable struct JiveTestSet <: AbstractTestSet
compile_time_start::UInt64
recompile_time_start::UInt64
Expand All @@ -13,7 +27,7 @@ mutable struct JiveTestSet <: AbstractTestSet
elapsed_time::UInt64
default::DefaultTestSet
function JiveTestSet(args...; kwargs...)
new(UInt64(0), UInt64(0), UInt64(0), UInt64(0), UInt64(0), UInt64(0), DefaultTestSet(args...; kwargs...))
new(UInt64(0), UInt64(0), UInt64(0), UInt64(0), UInt64(0), UInt64(0), compat_default_testset(args...; kwargs...))
end
end

Expand Down
32 changes: 15 additions & 17 deletions test/test/testset.jl
Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
# julia 1.6.0-DEV.1437 commit 68c71f577275a16fffb743b2058afdc2d635068f
module test_testset_verbose

using Test

if VERSION >= v"1.6.0-DEV.1437"
@testset "Verbose 1" verbose = true begin
@testset "Verbose 2" begin
@test true
end
@testset "Verbose 1" verbose = true begin
@testset "Verbose 2" begin
@test true
end
end

end # module test_testset_verbose


# julia 1.9.0-DEV.623 commit 88def1afe16acdfe41b15dc956742359d837ce04
module test_testset_failfast

using Test

@testset failfast = true begin
@test true
end

end # module test_testset_failfast


using Jive
@If VERSION >= v"1.8.0-DEV.809" module test_testset_42518
Expand All @@ -31,15 +41,3 @@ end
@testset bar(2)

end # module test_testset_42518


module test_testset_failfast

using Test

# julia 1.9.0-DEV.623 commit 88def1afe16acdfe41b15dc956742359d837ce04
@testset failfast = true begin
@test true
end

end # module test_testset_failfast

0 comments on commit eb44872

Please sign in to comment.