2024-03-21 16:15:07 +01:00
|
|
|
# Copyright (c) 2021-2024 Barcelona Supercomputing Center (BSC)
|
2022-09-19 12:39:02 +02:00
|
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
2022-09-29 12:41:59 +02:00
|
|
|
|
2023-11-02 18:21:26 +01:00
|
|
|
find_package(Nosv)
|
2022-09-29 12:41:59 +02:00
|
|
|
|
2023-11-02 18:21:26 +01:00
|
|
|
if(NOT NOSV_FOUND)
|
2023-05-30 18:16:08 +02:00
|
|
|
if(ENABLE_ALL_TESTS)
|
2023-11-02 18:21:26 +01:00
|
|
|
message(FATAL_ERROR "nOS-V not found, cannot enable nOS-V RT tests")
|
2023-05-30 18:16:08 +02:00
|
|
|
else()
|
2023-11-02 18:21:26 +01:00
|
|
|
message(STATUS "nOS-V not found, disabling nOS-V RT tests")
|
2023-05-30 18:16:08 +02:00
|
|
|
endif()
|
2022-09-29 12:41:59 +02:00
|
|
|
return()
|
|
|
|
endif()
|
|
|
|
|
2024-06-10 15:19:15 +02:00
|
|
|
# Needed for breakdown
|
|
|
|
if("${NOSV_VERSION}" VERSION_LESS "2.3.0")
|
|
|
|
message(FATAL_ERROR "nOS-V version ${NOSV_VERSION} too old, required at least 2.3.0")
|
2023-12-15 10:55:32 +01:00
|
|
|
endif()
|
|
|
|
|
|
|
|
message(STATUS "Enabling nOS-V RT tests")
|
|
|
|
|
2022-09-29 12:41:59 +02:00
|
|
|
function(nosv_test)
|
2023-11-02 17:54:14 +01:00
|
|
|
set(switches "")
|
|
|
|
set(single LEVEL)
|
|
|
|
set(multi "")
|
|
|
|
cmake_parse_arguments(
|
|
|
|
NOSV_TEST "${switches}" "${single}" "${multi}" ${ARGN})
|
2022-09-29 12:41:59 +02:00
|
|
|
ovni_test(${ARGN})
|
2023-11-02 18:21:26 +01:00
|
|
|
target_link_libraries("${OVNI_TEST_NAME}" PRIVATE PkgConfig::NOSV)
|
2022-09-29 12:41:59 +02:00
|
|
|
set_property(TEST "${OVNI_TEST_NAME}" APPEND
|
|
|
|
PROPERTY
|
|
|
|
ENVIRONMENT "NOSV_CONFIG=${OVNI_TEST_SOURCE_DIR}/rt/nosv/nosv.toml")
|
2024-03-21 16:15:07 +01:00
|
|
|
if(DEFINED NOSV_TEST_LEVEL)
|
2023-11-02 17:54:14 +01:00
|
|
|
set_property(TEST "${OVNI_TEST_NAME}" APPEND PROPERTY
|
|
|
|
ENVIRONMENT "NOSV_CONFIG_OVERRIDE=ovni.level=${NOSV_TEST_LEVEL}")
|
|
|
|
endif()
|
2022-09-29 12:41:59 +02:00
|
|
|
endfunction()
|
|
|
|
|
2023-02-15 19:32:34 +01:00
|
|
|
nosv_test(attach.c SORT)
|
|
|
|
nosv_test(waitfor.c SORT)
|
|
|
|
nosv_test(several-tasks.c SORT)
|
2024-02-06 14:12:43 +01:00
|
|
|
nosv_test(init-nested.c SORT)
|
2023-10-23 16:05:35 +02:00
|
|
|
nosv_test(parallel-tasks.c SORT)
|
|
|
|
nosv_test(inline.c SORT)
|
2024-03-27 12:02:27 +01:00
|
|
|
nosv_test(mutex.c SORT LEVEL 3)
|
|
|
|
nosv_test(barrier.c SORT LEVEL 3)
|
2023-11-02 17:54:14 +01:00
|
|
|
|
|
|
|
# Test multiple instrumentation levels
|
2023-12-15 10:55:32 +01:00
|
|
|
nosv_test(several-tasks.c SORT NAME several-tasks-level-0 LEVEL 0)
|
|
|
|
nosv_test(several-tasks.c SORT NAME several-tasks-level-1 LEVEL 1)
|
|
|
|
nosv_test(several-tasks.c SORT NAME several-tasks-level-2 LEVEL 2)
|
|
|
|
nosv_test(several-tasks.c SORT NAME several-tasks-level-3 LEVEL 3)
|
|
|
|
nosv_test(several-tasks.c SORT NAME several-tasks-level-4 LEVEL 4)
|
2024-06-10 15:19:15 +02:00
|
|
|
|
|
|
|
# Same but with breakdown enabled
|
|
|
|
nosv_test(several-tasks.c SORT NAME several-tasks-breakdown-level-0 LEVEL 0 BREAKDOWN)
|
|
|
|
nosv_test(several-tasks.c SORT NAME several-tasks-breakdown-level-1 LEVEL 1 BREAKDOWN)
|
|
|
|
nosv_test(several-tasks.c SORT NAME several-tasks-breakdown-level-2 LEVEL 2 BREAKDOWN)
|
|
|
|
nosv_test(several-tasks.c SORT NAME several-tasks-breakdown-level-3 LEVEL 3 BREAKDOWN)
|
|
|
|
nosv_test(several-tasks.c SORT NAME several-tasks-breakdown-level-4 LEVEL 4 BREAKDOWN)
|