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
9 changes: 9 additions & 0 deletions unittests/runtime/Actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,9 @@ TEST(ActorTest, actorSwitch) {
}

TEST(ActorTest, actorContention) {
#ifdef __SKIP_RDAR163604876__
GTEST_SKIP() << "Skipping due to rdar://163604876";
#endif
run([] {
using Context = TupleContext<AsyncTask*, TestActor*>;
auto actor = createActor();
Expand Down Expand Up @@ -387,6 +390,9 @@ TEST(ActorTest, actorContention) {
}

TEST(ActorTest, actorPriority) {
#ifdef __SKIP_RDAR163604876__
GTEST_SKIP() << "Skipping due to rdar://163604876";
#endif
run([] {
auto actor = createActor();

Expand Down Expand Up @@ -430,6 +436,9 @@ TEST(ActorTest, actorPriority) {
}

TEST(ActorTest, actorPriority2) {
#ifdef __SKIP_RDAR163604876__
GTEST_SKIP() << "Skipping due to rdar://163604876";
#endif
run([] {
auto actor = createActor();

Expand Down
33 changes: 33 additions & 0 deletions unittests/runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,37 @@ if(("${SWIFT_HOST_VARIANT_SDK}" STREQUAL "${SWIFT_PRIMARY_VARIANT_SDK}") AND
swiftThreading${SWIFT_PRIMARY_VARIANT_SUFFIX}
${PLATFORM_TARGET_LINK_LIBRARIES}
)

###
# GTEST_SKIP conditions.
#
# Sometimes, we need to skip running a unit test due to some bug on a specific
# platform. You can add a skip like this to the test:
#
# #ifdef __SKIP_RDAR123__
# GTEST_SKIP() << "Skipping due to rdar://123";
# #endif
#
# and use CMake to detect the OS, such as via
#
# if(EXISTS "/etc/os-release")
# file(READ "/etc/os-release" OS_RELEASE)
# if(OS_RELEASE MATCHES "Amazon Linux 2")
# ...
#
# and use
#
# target_compile_definitions(SwiftRuntimeTests PRIVATE __SKIP_RDAR123__)
#
# to add the preprocessor definition.


# A few unit tests with actor scheduling are failing AL2 aarch64 (rdar://163604876)
if(EXISTS "/etc/os-release")
file(READ "/etc/os-release" OS_RELEASE)
if(OS_RELEASE MATCHES "Amazon Linux 2" AND CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|ARM64|arm64")
target_compile_definitions(SwiftRuntimeTests PRIVATE __SKIP_RDAR163604876__)
endif()
endif()

endif()