Skip to content

Commit

Permalink
[NFC] Don't run conformance/asan tests on mock adapter
Browse files Browse the repository at this point in the history
Closes: #2215
  • Loading branch information
RossBrunton committed Oct 17, 2024
1 parent 7c19b36 commit 3568dbc
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ jobs:

- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "umf|loader|validation|tracing|unit|urtrace"
run: ctest -C ${{matrix.build_type}} --output-on-failure

fuzztest:
name: Fuzz tests short
Expand Down
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,16 @@ if(UR_USE_MSAN)
add_sanitizer_flag(memory)
endif()

set(ANY_ADAPTER ON)
if(NOT (UR_BUILD_ADAPTER_CUDA OR UR_BUILD_ADAPTER_HIP
OR UR_BUILD_ADAPTER_L0 OR UR_BUILD_ADAPTER_OPENCL
OR UR_BUILD_ADAPTER_NATIVE_CPU OR UR_BUILD_ADAPTER_L0_V2
OR UR_BUILD_ADAPTER_ALL))
message(WARNING "No adapters have been enabled; conformance and sanitizer tests will not be ran")
message(STATUS "Consider setting UR_BUILD_ADAPTER_*")
set(ANY_ADAPTER OFF)
endif()

# Check if clang-format (in correct version) is available for Cpp code formatting.
if(UR_FORMAT_CPP_STYLE)
find_program(CLANG_FORMAT NAMES clang-format-15 clang-format-15.0 clang-format)
Expand Down
7 changes: 0 additions & 7 deletions test/conformance/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,6 @@ function(add_conformance_test name)
if(UR_BUILD_ADAPTER_NATIVE_CPU OR UR_BUILD_ADAPTER_ALL)
add_test_adapter(${name} adapter_native_cpu NATIVE_CPU)
endif()

if(NOT (UR_BUILD_ADAPTER_CUDA OR UR_BUILD_ADAPTER_HIP
OR UR_BUILD_ADAPTER_L0 OR UR_BUILD_ADAPTER_OPENCL
OR UR_BUILD_ADAPTER_NATIVE_CPU OR UR_BUILD_ADAPTER_L0_V2
OR UR_BUILD_ADAPTER_ALL))
add_test_adapter(${name} adapter_mock MOCK)
endif()
endfunction()

function(add_conformance_test_with_kernels_environment name)
Expand Down
1 change: 0 additions & 1 deletion test/conformance/source/environment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ constexpr std::pair<const char *, ur_platform_backend_t> backends[] = {
{"HIP", UR_PLATFORM_BACKEND_HIP},
{"NATIVE_CPU", UR_PLATFORM_BACKEND_NATIVE_CPU},
{"UNKNOWN", UR_PLATFORM_BACKEND_UNKNOWN},
{"MOCK", UR_PLATFORM_BACKEND_UNKNOWN},
};

namespace {
Expand Down
4 changes: 3 additions & 1 deletion test/layers/sanitizer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@ function(add_sanitizer_test name)
set_sanitizer_test_properties(${name})
endfunction()

add_sanitizer_test(asan asan.cpp)
if(ANY_ADAPTER)
add_sanitizer_test(asan asan.cpp)
endif()

0 comments on commit 3568dbc

Please sign in to comment.