diff --git a/core/base/test/CMakeLists.txt b/core/base/test/CMakeLists.txt index 291d4399cbf87..ecc8e6161e57b 100644 --- a/core/base/test/CMakeLists.txt +++ b/core/base/test/CMakeLists.txt @@ -27,6 +27,25 @@ ROOT_ADD_GTEST(CoreErrorTests TErrorTests.cxx LIBRARIES Core) ROOT_ADD_GTEST(CoreSystemTests TSystemTests.cxx LIBRARIES Core) ROOT_ADD_GTEST(CoreColorTests TColorTests.cxx LIBRARIES Core) +if(CMAKE_SYSTEM_NAME MATCHES "Darwin" AND CMAKE_HOST_SYSTEM_VERSION VERSION_GREATER_EQUAL 25.4) + set_tests_properties(gtest-core-base-CoreColorTests PROPERTIES DISABLED True) + file(GENERATE + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/run_until_failure + CONTENT +"import subprocess +for _ in range(100): + try: + subprocess.run(['$'], check=True) + except subprocess.CalledProcessError as e: + print('This test is expected to fail with a stack corruption: ', e) + exit(123) +print('This test was expected to fail with a stack corruption. Check if it got fixed.') +exit(1)" + TARGET CoreColorTests) + + add_test(NAME CoreColor_RunUntilFailure COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/run_until_failure) + set_tests_properties(CoreColor_RunUntilFailure PROPERTIES SKIP_RETURN_CODE 123) +endif() configure_file(Foo.C Foo.C COPYONLY) ROOT_ADD_GTEST(IncludePathTest IncludePathTest.cxx LIBRARIES Core) diff --git a/core/base/test/TColorTests.cxx b/core/base/test/TColorTests.cxx index d95ce2d72a741..2e86bf19961e4 100644 --- a/core/base/test/TColorTests.cxx +++ b/core/base/test/TColorTests.cxx @@ -26,3 +26,24 @@ TEST(TColor, Hex8String) EXPECT_NEAR(color->GetBlue(), 0.690196, 1e-4); EXPECT_NEAR(color->GetAlpha(), 0.466667, 1e-4); } + +// ROOT-21367: On mac beta, the constructor of TColorGradient crashes with a stack corruption +TEST(TColor, Gradient) +{ + auto fcol1 = TColor::GetColor((Float_t)0.25, 0.25, 0.25, 0.55); // special frame color 1 + auto fcol2 = TColor::GetColor((Float_t)1., 1., 1., 0.05); // special frame color 2 + + auto frameGradient = TColor::GetLinearGradient(0., {fcol1, fcol2, fcol2, fcol1}, {0., 0.2, 0.8, 1.}); + + // This gradient is a mixture of two standard colors. + auto padGradient = TColor::GetLinearGradient(0., {30, 38}); + + // Another gradient built from three standard colors. + auto histGradient = TColor::GetLinearGradient(45., {kYellow, kOrange, kRed}); + + EXPECT_NE(fcol1, frameGradient); + EXPECT_NE(fcol1, padGradient); + EXPECT_NE(fcol1, histGradient); + EXPECT_NE(frameGradient, padGradient); + EXPECT_NE(padGradient, histGradient); +} diff --git a/tutorials/CMakeLists.txt b/tutorials/CMakeLists.txt index ae14321ec1967..4558d4556ba0f 100644 --- a/tutorials/CMakeLists.txt +++ b/tutorials/CMakeLists.txt @@ -740,6 +740,13 @@ foreach(t ${tutorials}) if(${t} IN_LIST multithreaded) set_tests_properties(tutorial-${tname} PROPERTIES PROCESSORS ${NProcessors}) endif() + + if(CMAKE_SYSTEM_NAME MATCHES "Darwin" AND CMAKE_HOST_SYSTEM_VERSION VERSION_GREATER_EQUAL 25.4 AND tname MATCHES "gl-.*grad") + # ROOT-21367 + # On mac beta, there is a stack corruption (suspected to be a compiler bug) that may fail these tests + set_tests_properties(tutorial-${tname} PROPERTIES DISABLED True) + message(NOTICE "Disabling tutorial ${tname} for mac beta") + endif() endforeach() #---Loop over all MPI tutorials and define the corresponding test---------