-
Notifications
You must be signed in to change notification settings - Fork 57
/
Copy pathCMakeLists.txt
51 lines (38 loc) · 1.35 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#
# Copyright (c) 2023 Arm Limited.
#
# SPDX-License-Identifier: MIT
#
cmake_minimum_required(VERSION 3.13.5)
# define the Catch2 entrypoint so that we don't have to recompile the implementation for each test group
add_library(catch-main STATIC main.cpp)
target_link_libraries(catch-main PUBLIC catch2)
function(add_test_target)
cmake_parse_arguments(ADD_TEST_TARGET "" "TARGET" "SOURCES;LIBRARIES" ${ARGN})
string(REPLACE ";" " " SOURCE_STR "${ADD_TEST_TARGET_SOURCES}")
add_executable(${ADD_TEST_TARGET_TARGET} ${SOURCE_STR})
string(REPLACE ";" " " LIBS_STR "${ADD_TEST_TARGET_LIBRARIES}")
target_link_libraries(${ADD_TEST_TARGET_TARGET} ${LIBS_STR} hwcpipe catch-main)
target_compile_options(${ADD_TEST_TARGET_TARGET}
PRIVATE -Werror
-Wswitch-default
-Wswitch-enum
)
catch_discover_tests(${ADD_TEST_TARGET_TARGET}
REPORTER junit
OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}
OUTPUT_SUFFIX ".result.xml"
)
endfunction()
add_test_target(TARGET counter-enumeration-test
SOURCES hwcpipe/counter_enumeration.cpp
)
add_test_target(TARGET counter-sampler-test
SOURCES counter-sampler.cpp
)
add_test_target(TARGET gpu-instance-test
SOURCES hwcpipe/gpu_instance.cpp
)
add_test_target(TARGET hwcpipe-double-test
SOURCES hwcpipe/hwcpipe_double.cpp
)