@@ -46,6 +46,11 @@ function scrub_exc_stack(stack)
46
46
return Any[ (x[1 ], scrub_backtrace (x[2 ])) for x in stack ]
47
47
end
48
48
49
+ # Compat for catch_stack(), which was deprecated in 1.7
50
+ @static if VERSION < v " 1.7"
51
+ current_exceptions () = Base. catch_stack ()
52
+ end
53
+
49
54
mutable struct Format
50
55
stats:: Bool
51
56
desc_align:: Int
@@ -531,7 +536,7 @@ function testset_beginend(mod::Module, isfinal::Bool, pat::Pattern, id::Int64, d
531
536
# something in the test block threw an error. Count that as an
532
537
# error in this test set
533
538
record (ts, Error (:nontest_error , Expr (:tuple ), err,
534
- Base . catch_stack (), $ (QuoteNode (source))))
539
+ current_exceptions (), $ (QuoteNode (source))))
535
540
finally
536
541
copy! (RNG, oldrng)
537
542
setresult! ($ marks, ts. subject, ! anyfailed (ts))
@@ -594,7 +599,7 @@ function testset_forloop(mod::Module, isfinal::Bool, pat::Pattern, id::Int64,
594
599
err isa InterruptException && rethrow ()
595
600
# Something in the test block threw an error. Count that as an
596
601
# error in this test set
597
- record (ts, Error (:nontest_error , Expr (:tuple ), err, Base . catch_stack (), $ (QuoteNode (source))))
602
+ record (ts, Error (:nontest_error , Expr (:tuple ), err, current_exceptions (), $ (QuoteNode (source))))
598
603
setresult! ($ marks, ts. subject, false )
599
604
end
600
605
end
@@ -667,9 +672,13 @@ macro stats(yes, ex)
667
672
end
668
673
end
669
674
670
- cumulative_compile_time_ns () =
671
- isdefined (Base, :cumulative_compile_time_ns ) ?
675
+ @static if VERSION >= v " 1.9"
676
+ # In 1.9 this function was changed to return a tuple of (compile_time, recompilation_time)
677
+ cumulative_compile_time_ns () = sum (Base. cumulative_compile_time_ns ())
678
+ else
679
+ cumulative_compile_time_ns () = isdefined (Base, :cumulative_compile_time_ns ) ?
672
680
Base. cumulative_compile_time_ns () :
673
681
UInt (0 )
682
+ end
674
683
675
684
end # module
0 commit comments