Skip to content

Commit

Permalink
CMake: use $<TARGET_FILE:target> to specify test executables
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Vrany <jan.vrany@fit.cvut.cz>
  • Loading branch information
janvrany committed Jan 30, 2021
1 parent 7be07ce commit 1a4352e
Show file tree
Hide file tree
Showing 18 changed files with 39 additions and 39 deletions.
4 changes: 2 additions & 2 deletions example/CMakeLists.txt
@@ -1,5 +1,5 @@
###############################################################################
# Copyright (c) 2017, 2020 IBM Corp. and others
# Copyright (c) 2017, 2021 IBM Corp. and others
#
# This program and the accompanying materials are made available under
# the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -50,7 +50,7 @@ if(OMR_GC)
${OMR_PORT_LIB}
)

add_test(NAME gcexample COMMAND gcexample)
add_test(NAME gcexample COMMAND $<TARGET_FILE:gcexample>)
endif(OMR_GC)

add_subdirectory(glue)
4 changes: 2 additions & 2 deletions fvtest/algotest/CMakeLists.txt
@@ -1,5 +1,5 @@
###############################################################################
# Copyright (c) 2017, 2020 IBM Corp. and others
# Copyright (c) 2017, 2021 IBM Corp. and others
#
# This program and the accompanying materials are made available under
# the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -64,4 +64,4 @@ endif()

set_property(TARGET omralgotest PROPERTY FOLDER fvtest)

add_test(NAME algotest COMMAND omralgotest --gtest_output=xml:${CMAKE_CURRENT_BINARY_DIR}/omralgotest-results.xml -avltest:${CMAKE_CURRENT_SOURCE_DIR}/avltest.lst)
add_test(NAME algotest COMMAND $<TARGET_FILE:omralgotest> --gtest_output=xml:${CMAKE_CURRENT_BINARY_DIR}/omralgotest-results.xml -avltest:${CMAKE_CURRENT_SOURCE_DIR}/avltest.lst)
4 changes: 2 additions & 2 deletions fvtest/compilertest/CMakeLists.txt
@@ -1,5 +1,5 @@
###############################################################################
# Copyright (c) 2017, 2020 IBM Corp. and others
# Copyright (c) 2017, 2021 IBM Corp. and others
#
# This program and the accompanying materials are made available under
# the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -124,5 +124,5 @@ target_link_libraries(compilertest
set_property(TARGET compilertest PROPERTY FOLDER fvtest)

if (NOT OMR_HOST_OS STREQUAL "aix")
add_test(NAME CompilerTest COMMAND compilertest --gtest_output=xml:${CMAKE_CURRENT_BINARY_DIR}/compilertest-results.xml)
add_test(NAME CompilerTest COMMAND $<TARGET_FILE:compilertest> --gtest_output=xml:${CMAKE_CURRENT_BINARY_DIR}/compilertest-results.xml)
endif()
4 changes: 2 additions & 2 deletions fvtest/compilertriltest/CMakeLists.txt
@@ -1,5 +1,5 @@
###############################################################################
# Copyright (c) 2017, 2020 IBM Corp. and others
# Copyright (c) 2017, 2021 IBM Corp. and others
#
# This program and the accompanying materials are made available under
# the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -72,5 +72,5 @@ set_property(TARGET comptest PROPERTY FOLDER fvtest)

add_test(
NAME comptest
COMMAND comptest --gtest_color=yes --gtest_output=xml:${CMAKE_CURRENT_BINARY_DIR}/comptest-results.xml
COMMAND $<TARGET_FILE:comptest> --gtest_color=yes --gtest_output=xml:${CMAKE_CURRENT_BINARY_DIR}/comptest-results.xml
)
4 changes: 2 additions & 2 deletions fvtest/compilerunittest/CMakeLists.txt
@@ -1,5 +1,5 @@
###############################################################################
# Copyright (c) 2020, 2020 IBM Corp. and others
# Copyright (c) 2020, 2021 IBM Corp. and others
#
# This program and the accompanying materials are made available under
# the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -66,5 +66,5 @@ set_property(TARGET compunittest PROPERTY FOLDER fvtest)

add_test(
NAME compunittest
COMMAND compunittest --gtest_color=yes --gtest_output=xml:${CMAKE_CURRENT_BINARY_DIR}/compunittest-results.xml
COMMAND $<TARGET_FILE:compunittest> --gtest_color=yes --gtest_output=xml:${CMAKE_CURRENT_BINARY_DIR}/compunittest-results.xml
)
2 changes: 1 addition & 1 deletion fvtest/gc_api_test/CMakeLists.txt
Expand Up @@ -36,6 +36,6 @@ function(omr_add_gc_test testname)
)
add_test(
NAME "${testname}"
COMMAND "${testname}" "--gtest_output=xml:${CMAKE_CURRENT_BINARY_DIR}/${testname}-results.xml"
COMMAND "$<TARGET_FILE:${testname}>" "--gtest_output=xml:${CMAKE_CURRENT_BINARY_DIR}/${testname}-results.xml"
)
endfunction(omr_add_gc_test)
4 changes: 2 additions & 2 deletions fvtest/gctest/CMakeLists.txt
@@ -1,5 +1,5 @@
###############################################################################
# Copyright (c) 2017, 2020 IBM Corp. and others
# Copyright (c) 2017, 2021 IBM Corp. and others
#
# This program and the accompanying materials are made available under
# the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -74,6 +74,6 @@ endif()
set_property(TARGET omrgctest PROPERTY FOLDER fvtest)

add_test(NAME gctest
COMMAND omrgctest "--gtest_filter=gcFunctionalTest*" "--gtest_output=xml:${CMAKE_CURRENT_BINARY_DIR}/omrgctest-results.xml"
COMMAND $<TARGET_FILE:omrgctest> "--gtest_filter=gcFunctionalTest*" "--gtest_output=xml:${CMAKE_CURRENT_BINARY_DIR}/omrgctest-results.xml"
WORKING_DIRECTORY "${omr_SOURCE_DIR}"
)
4 changes: 2 additions & 2 deletions fvtest/jitbuildertest/CMakeLists.txt
@@ -1,5 +1,5 @@
###############################################################################
# Copyright (c) 2017, 2020 IBM Corp. and others
# Copyright (c) 2017, 2021 IBM Corp. and others
#
# This program and the accompanying materials are made available under
# the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -60,5 +60,5 @@ set_property(TARGET jitbuildertest PROPERTY FOLDER fvtest)
# Disable JitBuilder tests on RISC-V. This is essentially a workaround
# until #4764 is addressed. Once done, tests should be properly skipped.
if(NOT OMR_HOST_ARCH STREQUAL "riscv")
add_test(NAME JitBuilderTest COMMAND jitbuildertest --gtest_output=xml:${CMAKE_CURRENT_BINARY_DIR}/jitbuildertest-results.xml)
add_test(NAME JitBuilderTest COMMAND $<TARGET_FILE:jitbuildertest> --gtest_output=xml:${CMAKE_CURRENT_BINARY_DIR}/jitbuildertest-results.xml)
endif()
4 changes: 2 additions & 2 deletions fvtest/lljbtest/CMakeLists.txt
@@ -1,5 +1,5 @@
###############################################################################
# Copyright (c) 2020, 2020 IBM Corp. and others
# Copyright (c) 2020, 2021 IBM Corp. and others
#
# This program and the accompanying materials are made available under
# the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -61,7 +61,7 @@ function(add_lljb_test test)
generate_module_from_cxx(${test})
add_test(
NAME lljb_${test}_test
COMMAND lljb_run ${test}.ll
COMMAND $<TARGET_FILE:lljb>_run ${test}.ll
)
endfunction(add_lljb_test)

Expand Down
6 changes: 3 additions & 3 deletions fvtest/porttest/CMakeLists.txt
@@ -1,5 +1,5 @@
###############################################################################
# Copyright (c) 2017, 2020 IBM Corp. and others
# Copyright (c) 2017, 2021 IBM Corp. and others
#
# This program and the accompanying materials are made available under
# the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -139,13 +139,13 @@ endif()
if (NOT OMR_HOST_OS STREQUAL "aix" AND NOT OMR_HOST_OS STREQUAL "zos")
add_test(
NAME porttest
COMMAND omrporttest --gtest_output=xml:${CMAKE_CURRENT_BINARY_DIR}/omrporttest-results.xml
COMMAND $<TARGET_FILE:omrporttest> --gtest_output=xml:${CMAKE_CURRENT_BINARY_DIR}/omrporttest-results.xml
)
endif()

if(OMR_OPT_CUDA)
add_test(
NAME cuda_porttest
COMMAND omrporttest --gtest_output=xml:${CMAKE_CURRENT_BINARY_DIR}/omrporttest-results.xml --gtest_filter="Cuda*" -earlyExit
COMMAND $<TARGET_FILE:omrporttest> --gtest_output=xml:${CMAKE_CURRENT_BINARY_DIR}/omrporttest-results.xml --gtest_filter="Cuda*" -earlyExit
)
endif()
8 changes: 4 additions & 4 deletions fvtest/rastest/CMakeLists.txt
@@ -1,5 +1,5 @@
###############################################################################
# Copyright (c) 2017, 2020 IBM Corp. and others
# Copyright (c) 2017, 2021 IBM Corp. and others
#
# This program and the accompanying materials are made available under
# the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -244,9 +244,9 @@ add_dependencies(omrtraceoptiontest
traceOptionAgent
)

add_test(NAME rastest COMMAND omrrastest --gtest_output=xml:${CMAKE_CURRENT_BINARY_DIR}/omrrastest-results.xml)
add_test(NAME subscribertest COMMAND omrsubscribertest --gtest_output=xml:${CMAKE_CURRENT_BINARY_DIR}/omrsubscribertest-results.xml)
add_test(NAME traceoptiontest COMMAND omrtraceoptiontest --gtest_output=xml:${CMAKE_CURRENT_BINARY_DIR}/omrtraceoptiontest-results.xml)
add_test(NAME rastest COMMAND $<TARGET_FILE:omrrastest> --gtest_output=xml:${CMAKE_CURRENT_BINARY_DIR}/omrrastest-results.xml)
add_test(NAME subscribertest COMMAND $<TARGET_FILE:omrsubscribertest> --gtest_output=xml:${CMAKE_CURRENT_BINARY_DIR}/omrsubscribertest-results.xml)
add_test(NAME traceoptiontest COMMAND $<TARGET_FILE:omrtraceoptiontest> --gtest_output=xml:${CMAKE_CURRENT_BINARY_DIR}/omrtraceoptiontest-results.xml)

set_target_properties(
omrrastest
Expand Down
4 changes: 2 additions & 2 deletions fvtest/sigtest/CMakeLists.txt
@@ -1,5 +1,5 @@
###############################################################################
# Copyright (c) 2017, 2020 IBM Corp. and others
# Copyright (c) 2017, 2021 IBM Corp. and others
#
# This program and the accompanying materials are made available under
# the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -87,4 +87,4 @@ endif()

set_property(TARGET omrsigtest PROPERTY FOLDER fvtest)

add_test(NAME sigtest COMMAND omrsigtest --gtest_output=xml:${CMAKE_CURRENT_BINARY_DIR}/omrsigtest-results.xml)
add_test(NAME sigtest COMMAND $<TARGET_FILE:omrsigtest> --gtest_output=xml:${CMAKE_CURRENT_BINARY_DIR}/omrsigtest-results.xml)
4 changes: 2 additions & 2 deletions fvtest/threadextendedtest/CMakeLists.txt
@@ -1,5 +1,5 @@
###############################################################################
# Copyright (c) 2017, 2020 IBM Corp. and others
# Copyright (c) 2017, 2021 IBM Corp. and others
#
# This program and the accompanying materials are made available under
# the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -44,5 +44,5 @@ endif()
set_property(TARGET omrthreadextendedtest PROPERTY FOLDER fvtest)

if (NOT OMR_HOST_OS STREQUAL "zos")
add_test(NAME threadextendedtest COMMAND omrthreadextendedtest --gtest_output=xml:${CMAKE_CURRENT_BINARY_DIR}/omrthreadextendedtest-results.xml)
add_test(NAME threadextendedtest COMMAND $<TARGET_FILE:omrthreadextendedtest> --gtest_output=xml:${CMAKE_CURRENT_BINARY_DIR}/omrthreadextendedtest-results.xml)
endif()
8 changes: 4 additions & 4 deletions fvtest/threadtest/CMakeLists.txt
@@ -1,5 +1,5 @@
###############################################################################
# Copyright (c) 2017, 2020 IBM Corp. and others
# Copyright (c) 2017, 2021 IBM Corp. and others
#
# This program and the accompanying materials are made available under
# the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -79,8 +79,8 @@ endif()

set_property(TARGET omrthreadtest PROPERTY FOLDER fvtest)

add_test(NAME threadtest COMMAND omrthreadtest --gtest_output=xml:${CMAKE_CURRENT_BINARY_DIR}/omrthreadtest-results.xml)
add_test(NAME threadSetAttrThreadWeightTest COMMAND omrthreadtest --gtest_output=xml:${CMAKE_CURRENT_BINARY_DIR}/omrthreadtest-results.xml --gtest_also_run_disabled_tests --gtest_filter=ThreadCreateTest.DISABLED_SetAttrThreadWeight)
add_test(NAME threadtest COMMAND $<TARGET_FILE:omrthreadtest> --gtest_output=xml:${CMAKE_CURRENT_BINARY_DIR}/omrthreadtest-results.xml)
add_test(NAME threadSetAttrThreadWeightTest COMMAND $<TARGET_FILE:omrthreadtest> --gtest_output=xml:${CMAKE_CURRENT_BINARY_DIR}/omrthreadtest-results.xml --gtest_also_run_disabled_tests --gtest_filter=ThreadCreateTest.DISABLED_SetAttrThreadWeight)
if(OMR_HOST_OS STREQUAL "linux")
add_test(NAME threadRealtimeTest COMMAND omrthreadtest --gtest_output=xml:${CMAKE_CURRENT_BINARY_DIR}/omrthreadtest-results.xml --gtest_filter=ThreadCreateTest.* -realtime)
add_test(NAME threadRealtimeTest COMMAND $<TARGET_FILE:omrthreadtest> --gtest_output=xml:${CMAKE_CURRENT_BINARY_DIR}/omrthreadtest-results.xml --gtest_filter=ThreadCreateTest.* -realtime)
endif()
4 changes: 2 additions & 2 deletions fvtest/tril/test/CMakeLists.txt
@@ -1,5 +1,5 @@
###############################################################################
# Copyright (c) 2017, 2020 IBM Corp. and others
# Copyright (c) 2017, 2021 IBM Corp. and others
#
# This program and the accompanying materials are made available under
# the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -57,5 +57,5 @@ set_property(TARGET triltest PROPERTY FOLDER fvtest/tril)

add_test(
NAME triltest
COMMAND triltest --gtest_output=xml:${CMAKE_CURRENT_BINARY_DIR}/triltest-results.xml
COMMAND $<TARGET_FILE:triltest> --gtest_output=xml:${CMAKE_CURRENT_BINARY_DIR}/triltest-results.xml
)
4 changes: 2 additions & 2 deletions fvtest/utiltest/CMakeLists.txt
@@ -1,5 +1,5 @@
###############################################################################
# Copyright (c) 2017, 2017 IBM Corp. and others
# Copyright (c) 2017, 2021 IBM Corp. and others
#
# This program and the accompanying materials are made available under
# the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -40,4 +40,4 @@ endif()

set_property(TARGET omrutiltest PROPERTY FOLDER fvtest)

add_test(NAME utiltest COMMAND omrutiltest --gtest_output=xml:${CMAKE_CURRENT_BINARY_DIR}/omrutiltest-results.xml)
add_test(NAME utiltest COMMAND $<TARGET_FILE:omrutiltest> --gtest_output=xml:${CMAKE_CURRENT_BINARY_DIR}/omrutiltest-results.xml)
4 changes: 2 additions & 2 deletions fvtest/vmtest/CMakeLists.txt
@@ -1,5 +1,5 @@
###############################################################################
# Copyright (c) 2017, 2020 IBM Corp. and others
# Copyright (c) 2017, 2021 IBM Corp. and others
#
# This program and the accompanying materials are made available under
# the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -40,4 +40,4 @@ target_link_libraries(omrvmtest

set_property(TARGET omrvmtest PROPERTY FOLDER fvtest)

add_test(NAME vmtest COMMAND omrvmtest --gtest_output=xml:${CMAKE_CURRENT_BINARY_DIR}/omrvmtest-results.xml)
add_test(NAME vmtest COMMAND $<TARGET_FILE:omrvmtest> --gtest_output=xml:${CMAKE_CURRENT_BINARY_DIR}/omrvmtest-results.xml)
2 changes: 1 addition & 1 deletion jitbuilder/release/CMakeLists.txt
Expand Up @@ -31,7 +31,7 @@ macro(create_jitbuilder_test target)
target_link_libraries(${target}
jitbuilder
${CMAKE_DL_LIBS})
add_test(NAME ${target}_example_as_test COMMAND ${target})
add_test(NAME ${target}_example_as_test COMMAND $<TARGET_FILE:${target}>)
endmacro(create_jitbuilder_test)

# Basic Tests: These should run properly on all platforms.
Expand Down

0 comments on commit 1a4352e

Please sign in to comment.