Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions core/base/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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(['$<TARGET_FILE:CoreColorTests>'], 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)
21 changes: 21 additions & 0 deletions core/base/test/TColorTests.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
7 changes: 7 additions & 0 deletions tutorials/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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---------
Expand Down
Loading