Compute test name from source file
This commit is contained in:
parent
7c6beb091a
commit
6551ba80b1
@ -19,7 +19,7 @@ set(OVNI_TEST_BUILD_DIR "${CMAKE_BINARY_DIR}/test")
|
|||||||
|
|
||||||
include(macros.cmake)
|
include(macros.cmake)
|
||||||
|
|
||||||
add_subdirectory(manual)
|
add_subdirectory(emu)
|
||||||
|
|
||||||
if(ENABLE_TEST_RT)
|
if(ENABLE_TEST_RT)
|
||||||
add_subdirectory(rt)
|
add_subdirectory(rt)
|
||||||
|
@ -14,11 +14,11 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
ovni_test(NAME nanos6-nested-tasks)
|
ovni_test(nested-tasks.c)
|
||||||
ovni_test(NAME nanos6-nested-tasks-bad SHOULD_FAIL
|
ovni_test(nested-tasks-bad.c SHOULD_FAIL
|
||||||
REGEX "fatal: cannot execute task 1: state is not created")
|
REGEX "fatal: cannot execute task 1: state is not created")
|
||||||
ovni_test(NAME nanos6-task-types MP)
|
ovni_test(task-types.c MP)
|
||||||
ovni_test(NAME nanos6-blocking MP)
|
ovni_test(blocking.c MP)
|
||||||
ovni_test(NAME nanos6-subsystems MP)
|
ovni_test(subsystems.c MP)
|
||||||
ovni_test(NAME nanos6-ss-mismatch SHOULD_FAIL
|
ovni_test(ss-mismatch.c SHOULD_FAIL
|
||||||
REGEX "thread [0-9]\\+ ended with 1 extra stacked nanos6 subsystems, top=ST_NANOS6_SCHED_HUNGRY")
|
REGEX "thread [0-9]\\+ ended with 1 extra stacked nanos6 subsystems, top=ST_NANOS6_SCHED_HUNGRY")
|
@ -14,8 +14,8 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
ovni_test(NAME nosv-nested-tasks)
|
ovni_test(nested-tasks.c)
|
||||||
ovni_test(NAME nosv-nested-tasks-bad SHOULD_FAIL
|
ovni_test(nested-tasks-bad.c SHOULD_FAIL
|
||||||
REGEX "fatal: cannot execute task 1: state is not created")
|
REGEX "fatal: cannot execute task 1: state is not created")
|
||||||
ovni_test(NAME nosv-task-types MP)
|
ovni_test(task-types.c MP)
|
||||||
ovni_test(NAME nosv-pause MP)
|
ovni_test(pause.c MP)
|
@ -16,9 +16,9 @@
|
|||||||
|
|
||||||
# Only run performance sensitive tests on Release builds
|
# Only run performance sensitive tests on Release builds
|
||||||
if(CMAKE_BUILD_TYPE STREQUAL "Release")
|
if(CMAKE_BUILD_TYPE STREQUAL "Release")
|
||||||
ovni_test(NAME flush-overhead)
|
ovni_test(flush-overhead.c)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
ovni_test(NAME flush)
|
ovni_test(flush.c)
|
||||||
ovni_test(NAME mp-simple MP)
|
ovni_test(mp-simple.c MP)
|
||||||
ovni_test(NAME mp-rank MP)
|
ovni_test(mp-rank.c MP)
|
@ -1,24 +1,24 @@
|
|||||||
include(CMakeParseArguments)
|
include(CMakeParseArguments)
|
||||||
|
|
||||||
function(ovni_test)
|
function(ovni_test source)
|
||||||
set(switches MP SHOULD_FAIL)
|
set(switches MP SHOULD_FAIL)
|
||||||
set(single NPROC NAME REGEX)
|
set(single NPROC REGEX)
|
||||||
set(multi SOURCE ENV)
|
set(multi ENV)
|
||||||
|
|
||||||
|
# Compute the test name from the source and path
|
||||||
|
cmake_path(RELATIVE_PATH CMAKE_CURRENT_SOURCE_DIR
|
||||||
|
BASE_DIRECTORY "${OVNI_TEST_SOURCE_DIR}"
|
||||||
|
OUTPUT_VARIABLE name_prefix)
|
||||||
|
set(full_path "${name_prefix}/${source}")
|
||||||
|
string(REGEX REPLACE "\.c$" "" full_path_noext "${full_path}")
|
||||||
|
string(REPLACE "/" "-" name "${full_path_noext}")
|
||||||
|
|
||||||
cmake_parse_arguments(
|
cmake_parse_arguments(
|
||||||
OVNI_TEST "${switches}" "${single}" "${multi}" ${ARGN})
|
OVNI_TEST "${switches}" "${single}" "${multi}" ${ARGN})
|
||||||
|
|
||||||
if(NOT OVNI_TEST_NAME)
|
set(OVNI_TEST_NAME ${name} PARENT_SCOPE)
|
||||||
message(FATAL_ERROR "You must provide a test NAME")
|
set(OVNI_TEST_NAME ${name})
|
||||||
endif(NOT OVNI_TEST_NAME)
|
set(OVNI_TEST_SOURCE ${source})
|
||||||
|
|
||||||
set(OVNI_TEST_NAME ${OVNI_TEST_NAME} PARENT_SCOPE)
|
|
||||||
|
|
||||||
# Set default source if not given
|
|
||||||
if(NOT OVNI_TEST_SOURCE)
|
|
||||||
set(OVNI_TEST_SOURCE "${OVNI_TEST_NAME}.c")
|
|
||||||
#message("Setting default source to ${OVNI_TEST_SOURCE}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(NOT OVNI_TEST_NPROC)
|
if(NOT OVNI_TEST_NPROC)
|
||||||
if(NOT OVNI_TEST_MP)
|
if(NOT OVNI_TEST_MP)
|
||||||
|
@ -27,6 +27,6 @@ function(nosv_test)
|
|||||||
ENVIRONMENT "NOSV_CONFIG=${OVNI_TEST_SOURCE_DIR}/rt/nosv/nosv.toml")
|
ENVIRONMENT "NOSV_CONFIG=${OVNI_TEST_SOURCE_DIR}/rt/nosv/nosv.toml")
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
nosv_test(NAME nosv-attach SOURCE nosv/attach.c)
|
nosv_test(nosv/attach.c)
|
||||||
|
|
||||||
add_subdirectory(nanos6)
|
add_subdirectory(nanos6)
|
||||||
|
@ -6,5 +6,5 @@ function(nanos6_rt_test)
|
|||||||
ENVIRONMENT "NANOS6_CONFIG=${OVNI_TEST_SOURCE_DIR}/rt/nanos6/nanos6.toml")
|
ENVIRONMENT "NANOS6_CONFIG=${OVNI_TEST_SOURCE_DIR}/rt/nanos6/nanos6.toml")
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
nanos6_rt_test(NAME rt-nanos6-simple-task SOURCE simple-task.c)
|
nanos6_rt_test(simple-task.c)
|
||||||
nanos6_rt_test(NAME rt-nanos6-nested-task SOURCE nested-task.c)
|
nanos6_rt_test(nested-task.c)
|
||||||
|
Loading…
Reference in New Issue
Block a user