| 1 |
# |
| 2 |
# SPDX-License-Identifier: BSD-3-Clause |
| 3 |
# Copyright © 2021-2024 Inria. All rights reserved. |
| 4 |
# See COPYING in top-level directory. |
| 5 |
# |
| 6 |
|
| 7 |
foreach(t api_version backends bind |
| 8 |
bitmap bitmap_compare_inclusion bitmap_first_last_weight bitmap_singlify bitmap_string |
| 9 |
distances get_area_memlocation get_cache_covering_cpuset get_closest_objs get_largest_objs_inside_cpuset |
| 10 |
get_last_cpu_location get_next_obj_covering_cpuset get_obj_below_array_by_type get_obj_covering_cpuset |
| 11 |
get_obj_inside_cpuset get_obj_with_same_locality get_shared_cache_covering_obj |
| 12 |
groups insert_misc iodevs is_thissystem list_components obj_infos object_userdata pci_backend synthetic |
| 13 |
topology_abi topology_allow topology_diff topology_dup topology_restrict type_depth type_sscanf |
| 14 |
) |
| 15 |
add_executable(hwloc_${t} ${TOPDIR}/tests/hwloc/hwloc_${t}.c) |
| 16 |
target_link_libraries(hwloc_${t} PRIVATE hwloc) |
| 17 |
|
| 18 |
add_test(NAME ${t} COMMAND hwloc_${t} WORKING_DIRECTORY ${PROJECT_BINARY_DIR}) |
| 19 |
set_tests_properties(${t} PROPERTIES TIMEOUT 10) |
| 20 |
endforeach() |
| 21 |
|
| 22 |
foreach(t cpuset_nodeset memattrs cpukinds gl windows_processor_groups) |
| 23 |
add_executable(${t} ${TOPDIR}/tests/hwloc/${t}.c) |
| 24 |
target_link_libraries(${t} PRIVATE hwloc) |
| 25 |
|
| 26 |
add_test(NAME ${t} COMMAND ${t} WORKING_DIRECTORY ${PROJECT_BINARY_DIR}) |
| 27 |
set_tests_properties(${t} PROPERTIES TIMEOUT 10) |
| 28 |
endforeach() |
| 29 |
|
| 30 |
add_executable(xmlbuffer ${TOPDIR}/tests/hwloc/xmlbuffer.c) |
| 31 |
target_link_libraries(xmlbuffer PRIVATE hwloc) |
| 32 |
add_test(NAME xmlbuffer00 COMMAND xmlbuffer 0 0 WORKING_DIRECTORY ${PROJECT_BINARY_DIR}) |
| 33 |
add_test(NAME xmlbuffer01 COMMAND xmlbuffer 0 1 WORKING_DIRECTORY ${PROJECT_BINARY_DIR}) |
| 34 |
add_test(NAME xmlbuffer10 COMMAND xmlbuffer 1 0 WORKING_DIRECTORY ${PROJECT_BINARY_DIR}) |
| 35 |
add_test(NAME xmlbuffer11 COMMAND xmlbuffer 1 1 WORKING_DIRECTORY ${PROJECT_BINARY_DIR}) |
| 36 |
set_tests_properties(xmlbuffer00 xmlbuffer01 xmlbuffer10 xmlbuffer11 PROPERTIES TIMEOUT 10) |
| 37 |
|
| 38 |
target_compile_definitions(hwloc_type_sscanf PRIVATE XMLTESTDIR=\"${CMAKE_CURRENT_SOURCE_DIR}/xml/\") |
| 39 |
|
| 40 |
set_tests_properties(get_obj_with_same_locality PROPERTIES ENVIRONMENT HWLOC_TOP_SRCDIR=${TOPDIR}) |
| 41 |
|
| 42 |
add_test(NAME lstopo-no-graphics:verbose COMMAND lstopo-no-graphics -v) |
| 43 |
add_test(NAME lstopo-no-graphics:groups COMMAND lstopo-no-graphics --windows-processor-groups) |
| 44 |
set_tests_properties(lstopo-no-graphics:verbose lstopo-no-graphics:groups PROPERTIES |
| 45 |
DISABLED ${HWLOC_SKIP_LSTOPO} |
| 46 |
LABELS exe |
| 47 |
TIMEOUT 10 |
| 48 |
) |
| 49 |
|
| 50 |
add_test(NAME hwloc-info:support COMMAND hwloc-info --support) |
| 51 |
set_tests_properties(hwloc-info:support PROPERTIES |
| 52 |
DISABLED ${HWLOC_SKIP_TOOLS} |
| 53 |
LABELS exe |
| 54 |
TIMEOUT 10 |
| 55 |
) |
| 56 |
|
| 57 |
|
| 58 |
# --- optional tests |
| 59 |
|
| 60 |
if(HWLOC_HAVE_OPENCL) |
| 61 |
add_executable(test_opencl ${TOPDIR}/tests/hwloc/opencl.c) |
| 62 |
target_link_libraries(test_opencl PRIVATE hwloc OpenCL::OpenCL) |
| 63 |
|
| 64 |
add_test(NAME OpenCL COMMAND test_opencl) |
| 65 |
set_tests_properties(OpenCL PROPERTIES TIMEOUT 10) |
| 66 |
endif() |
| 67 |
|
| 68 |
if(HAVE_CUDA) |
| 69 |
add_executable(test_cuda ${TOPDIR}/tests/hwloc/cuda.c) |
| 70 |
target_link_libraries(test_cuda PRIVATE hwloc CUDA::cudart CUDA::cuda_driver) |
| 71 |
|
| 72 |
add_test(NAME CUDA COMMAND test_cuda) |
| 73 |
set_tests_properties(CUDA PROPERTIES TIMEOUT 10) |
| 74 |
endif() |