From 1b75b48e7735ce4d3f198fe54c8d391554f0bd5a Mon Sep 17 00:00:00 2001 From: Christian Guinard <28689358+christiangnrd@users.noreply.github.com> Date: Thu, 2 Oct 2025 13:45:55 -0300 Subject: [PATCH 1/4] Nightly test runner fixes --- test/runtests.jl | 11 +++++++++-- test/setup.jl | 15 +++++++++------ 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index 1efbbcc94..4c3de1500 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -351,8 +351,8 @@ println("Testing finished in $elapsed") else # construct a testset to render the test results o_ts = Test.DefaultTestSet("Overall") + completed_tests = Set{String}() Test.@with_testset o_ts begin - completed_tests = Set{String}() for (testname, (resp,)) in results push!(completed_tests, testname) if isa(resp, Test.DefaultTestSet) @@ -413,7 +413,14 @@ else end println() Test.print_test_results(o_ts, 1) - if !o_ts.anynonpass + + success = @static if VERSION < v"1.13.0-DEV.1044" + !o_ts.anynonpass + else + o_ts.anynonpass == 0x1 + end + + if success println(" \033[32;1mSUCCESS\033[0m") else println(" \033[31;1mFAILURE\033[0m\n") diff --git a/test/setup.jl b/test/setup.jl index ea0945b28..3fa69f848 100644 --- a/test/setup.jl +++ b/test/setup.jl @@ -4,15 +4,16 @@ include("testsuite.jl") using Random +@static if VERSION >= v"1.13.0-DEV.1044" + using Base.ScopedValues +end ## entry point function runtests(f, name) - old_print_setting = Test.TESTSET_PRINT_ENABLE[] @static if VERSION < v"1.13.0-DEV.1044" + old_print_setting = Test.TESTSET_PRINT_ENABLE[] Test.TESTSET_PRINT_ENABLE[] = false - else - Test.TESTSET_PRINT_ENABLE[] => false end try @@ -34,7 +35,11 @@ function runtests(f, name) $f() end end - data = Core.eval(mod, ex) + data = @static if VERSION < v"1.13.0-DEV.1044" + Core.eval(mod, ex) + else + @with Test.TESTSET_PRINT_ENABLE => false Core.eval(mod, ex) + end #data[1] is the testset # process results @@ -62,8 +67,6 @@ function runtests(f, name) finally @static if VERSION < v"1.13.0-DEV.1044" Test.TESTSET_PRINT_ENABLE[] = old_print_setting - else - Test.TESTSET_PRINT_ENABLE[] => old_print_setting end end end From bf13ce077c26559738539adfb68b7774b337b77f Mon Sep 17 00:00:00 2001 From: Christian Guinard <28689358+christiangnrd@users.noreply.github.com> Date: Thu, 2 Oct 2025 13:49:08 -0300 Subject: [PATCH 2/4] `and_all` and `or_any` --- src/host/mapreduce.jl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/host/mapreduce.jl b/src/host/mapreduce.jl index 4a1283138..f5d301306 100644 --- a/src/host/mapreduce.jl +++ b/src/host/mapreduce.jl @@ -24,6 +24,12 @@ neutral_element(::typeof(Base.mul_prod), T) = one(T) neutral_element(::typeof(Base.min), T) = typemax(T) neutral_element(::typeof(Base.max), T) = typemin(T) neutral_element(::typeof(Base._extrema_rf), ::Type{<:NTuple{2,T}}) where {T} = typemax(T), typemin(T) +@static if isdefined(Base, :and_all) # VERSION >~ v"1.13-" + neutral_element(::typeof(Base.:(and_all)), T) = ~zero(T) +end +@static if isdefined(Base, :or_any) # VERSION >~ v"1.13-" + neutral_element(::typeof(Base.:(or_any)), T) = zero(T) +end # resolve ambiguities Base.mapreduce(f, op, A::AnyGPUArray, As::AbstractArrayOrBroadcasted...; From 459206e0483a2c2cc96a5e4da016f9873ec6907e Mon Sep 17 00:00:00 2001 From: Christian Guinard <28689358+christiangnrd@users.noreply.github.com> Date: Thu, 2 Oct 2025 14:02:36 -0300 Subject: [PATCH 3/4] Formatting --- test/runtests.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/runtests.jl b/test/runtests.jl index 4c3de1500..0a98722ce 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -417,7 +417,7 @@ else success = @static if VERSION < v"1.13.0-DEV.1044" !o_ts.anynonpass else - o_ts.anynonpass == 0x1 + o_ts.anynonpass == 0x01 end if success From 7d9a9b99886093a36737e101c1135805cd002b19 Mon Sep 17 00:00:00 2001 From: Christian Guinard <28689358+christiangnrd@users.noreply.github.com> Date: Sun, 5 Oct 2025 16:33:48 -0300 Subject: [PATCH 4/4] Factor out common code --- test/runtests.jl | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index 0a98722ce..abc81ee0b 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -276,11 +276,11 @@ t1 = now() elapsed = canonicalize(Dates.CompoundPeriod(t1-t0)) println("Testing finished in $elapsed") +# construct a testset to render the test results +completed_tests = Set{String}() +o_ts = Test.DefaultTestSet("Overall") @static if VERSION < v"1.13.0-DEV.1044" - # construct a testset to render the test results - o_ts = Test.DefaultTestSet("Overall") Test.push_testset(o_ts) - completed_tests = Set{String}() for (testname, (resp,)) in results push!(completed_tests, testname) if isa(resp, Test.DefaultTestSet) @@ -349,9 +349,6 @@ println("Testing finished in $elapsed") throw(Test.FallbackTestSetException("Test run finished with errors")) end else - # construct a testset to render the test results - o_ts = Test.DefaultTestSet("Overall") - completed_tests = Set{String}() Test.@with_testset o_ts begin for (testname, (resp,)) in results push!(completed_tests, testname)