diff --git a/test/integration/cmake_package/CMakeLists.txt b/test/integration/cmake_package/CMakeLists.txt index b4185b5..e609375 100644 --- a/test/integration/cmake_package/CMakeLists.txt +++ b/test/integration/cmake_package/CMakeLists.txt @@ -9,42 +9,44 @@ set(use_instructions_build_dir ${CMAKE_CURRENT_BINARY_DIR}/use_instructions) file(MAKE_DIRECTORY ${build_dir} ${use_evmc_build_dir} ${use_instructions_build_dir}) +set(prefix ${PROJECT_NAME}/cmake_packge) + add_test( - NAME cmake_package/configure + NAME ${prefix}/configure COMMAND ${CMAKE_COMMAND} -G ${CMAKE_GENERATOR} ${PROJECT_SOURCE_DIR} -DCMAKE_INSTALL_PREFIX=${install_dir} WORKING_DIRECTORY ${build_dir} ) add_test( - NAME cmake_package/install + NAME ${prefix}/install COMMAND ${CMAKE_COMMAND} --build ${build_dir} --target install ) -set_tests_properties(cmake_package/install PROPERTIES DEPENDS cmake_package/configure) +set_tests_properties(${prefix}/install PROPERTIES DEPENDS ${prefix}/configure) add_test( - NAME cmake_package/use_evmc/configure + NAME ${prefix}/use_evmc/configure COMMAND ${CMAKE_COMMAND} -G ${CMAKE_GENERATOR} ${PROJECT_SOURCE_DIR}/examples/use_evmc_in_cmake -DCMAKE_PREFIX_PATH=${install_dir} WORKING_DIRECTORY ${use_evmc_build_dir} ) -set_tests_properties(cmake_package/use_evmc/configure PROPERTIES DEPENDS cmake_package/install) +set_tests_properties(${prefix}/use_evmc/configure PROPERTIES DEPENDS ${prefix}/install) add_test( - NAME cmake_package/use_evmc/build + NAME ${prefix}/use_evmc/build COMMAND ${CMAKE_COMMAND} --build ${use_evmc_build_dir} ) -set_tests_properties(cmake_package/use_evmc/build PROPERTIES DEPENDS cmake_package/use_evmc/configure) +set_tests_properties(${prefix}/use_evmc/build PROPERTIES DEPENDS ${prefix}/use_evmc/configure) add_test( - NAME cmake_package/use_instructions/configure + NAME ${prefix}/use_instructions/configure COMMAND ${CMAKE_COMMAND} -G ${CMAKE_GENERATOR} ${PROJECT_SOURCE_DIR}/examples/use_instructions_in_cmake -DCMAKE_PREFIX_PATH=${install_dir} WORKING_DIRECTORY ${use_instructions_build_dir} ) -set_tests_properties(cmake_package/use_instructions/configure PROPERTIES DEPENDS cmake_package/install) +set_tests_properties(${prefix}/use_instructions/configure PROPERTIES DEPENDS ${prefix}/install) add_test( - NAME cmake_package/use_instructions/build + NAME ${prefix}/use_instructions/build COMMAND ${CMAKE_COMMAND} --build ${use_instructions_build_dir} ) -set_tests_properties(cmake_package/use_instructions/build PROPERTIES DEPENDS cmake_package/use_instructions/configure) +set_tests_properties(${prefix}/use_instructions/build PROPERTIES DEPENDS ${prefix}/use_instructions/configure) diff --git a/test/unittests/CMakeLists.txt b/test/unittests/CMakeLists.txt index 0275363..957ad0d 100644 --- a/test/unittests/CMakeLists.txt +++ b/test/unittests/CMakeLists.txt @@ -20,4 +20,4 @@ add_executable( target_link_libraries(evmc-unittests PRIVATE loader-mocked evmc-example-vm-static evmc-example-host instructions GTest::gtest GTest::main) set_target_properties(evmc-unittests PROPERTIES RUNTIME_OUTPUT_DIRECTORY ..) -gtest_add_tests(TARGET evmc-unittests TEST_PREFIX unittests/) +gtest_add_tests(TARGET evmc-unittests TEST_PREFIX ${PROJECT_NAME}/unittests/) diff --git a/test/vmtester/CMakeLists.txt b/test/vmtester/CMakeLists.txt index d22cb61..2f33200 100644 --- a/test/vmtester/CMakeLists.txt +++ b/test/vmtester/CMakeLists.txt @@ -12,26 +12,28 @@ set_source_files_properties(vmtester.cpp PROPERTIES COMPILE_DEFINITIONS PROJECT_ install(TARGETS evmc-vmtester RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -add_test(NAME vmtester/examplevm COMMAND evmc-vmtester $) -add_test(NAME vmtester/example_precompiles_vm COMMAND evmc-vmtester $) +set(prefix ${PROJECT_NAME}/vmtester) -add_test(NAME vmtester/help COMMAND evmc-vmtester --version --help) -set_tests_properties(vmtester/help PROPERTIES PASS_REGULAR_EXPRESSION "Usage:") +add_test(NAME ${prefix}/examplevm COMMAND evmc-vmtester $) +add_test(NAME ${prefix}/example_precompiles_vm COMMAND evmc-vmtester $) -add_test(NAME vmtester/nonexistingvm COMMAND evmc-vmtester nonexistingvm) -set_tests_properties(vmtester/nonexistingvm PROPERTIES PASS_REGULAR_EXPRESSION "[Cc]annot open") +add_test(NAME ${prefix}/help COMMAND evmc-vmtester --version --help) +set_tests_properties(${prefix}/help PROPERTIES PASS_REGULAR_EXPRESSION "Usage:") -add_test(NAME vmtester/noarg COMMAND evmc-vmtester) -set_tests_properties(vmtester/noarg PROPERTIES PASS_REGULAR_EXPRESSION "is required") +add_test(NAME ${prefix}/nonexistingvm COMMAND evmc-vmtester nonexistingvm) +set_tests_properties(${prefix}/nonexistingvm PROPERTIES PASS_REGULAR_EXPRESSION "[Cc]annot open") -add_test(NAME vmtester/too-many-args COMMAND evmc-vmtester a b) -set_tests_properties(vmtester/too-many-args PROPERTIES PASS_REGULAR_EXPRESSION "Unexpected") +add_test(NAME ${prefix}/noarg COMMAND evmc-vmtester) +set_tests_properties(${prefix}/noarg PROPERTIES PASS_REGULAR_EXPRESSION "is required") -add_test(NAME vmtester/version COMMAND evmc-vmtester --version) -set_tests_properties(vmtester/version PROPERTIES PASS_REGULAR_EXPRESSION ${PROJECT_VERSION}) +add_test(NAME ${prefix}/too-many-args COMMAND evmc-vmtester a b) +set_tests_properties(${prefix}/too-many-args PROPERTIES PASS_REGULAR_EXPRESSION "Unexpected") -add_test(NAME vmtester/unknown-option COMMAND evmc-vmtester --verbose) -set_tests_properties(vmtester/unknown-option PROPERTIES PASS_REGULAR_EXPRESSION "Unknown") +add_test(NAME ${prefix}/version COMMAND evmc-vmtester --version) +set_tests_properties(${prefix}/version PROPERTIES PASS_REGULAR_EXPRESSION ${PROJECT_VERSION}) -add_test(NAME vmtester/option-long-prefix COMMAND evmc-vmtester ---) -set_tests_properties(vmtester/option-long-prefix PROPERTIES PASS_REGULAR_EXPRESSION "Unknown") +add_test(NAME ${prefix}/unknown-option COMMAND evmc-vmtester --verbose) +set_tests_properties(${prefix}/unknown-option PROPERTIES PASS_REGULAR_EXPRESSION "Unknown") + +add_test(NAME ${prefix}/option-long-prefix COMMAND evmc-vmtester ---) +set_tests_properties(${prefix}/option-long-prefix PROPERTIES PASS_REGULAR_EXPRESSION "Unknown")