cmake: Add evmc/ prefix to ctest names

This commit is contained in:
Paweł Bylica 2019-05-15 14:45:10 +02:00
parent 0fb409ee83
commit 7b42c81f53
No known key found for this signature in database
GPG Key ID: 7A0C037434FE77EF
3 changed files with 32 additions and 28 deletions

View File

@ -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}) file(MAKE_DIRECTORY ${build_dir} ${use_evmc_build_dir} ${use_instructions_build_dir})
set(prefix ${PROJECT_NAME}/cmake_packge)
add_test( add_test(
NAME cmake_package/configure NAME ${prefix}/configure
COMMAND ${CMAKE_COMMAND} -G ${CMAKE_GENERATOR} ${PROJECT_SOURCE_DIR} -DCMAKE_INSTALL_PREFIX=${install_dir} COMMAND ${CMAKE_COMMAND} -G ${CMAKE_GENERATOR} ${PROJECT_SOURCE_DIR} -DCMAKE_INSTALL_PREFIX=${install_dir}
WORKING_DIRECTORY ${build_dir} WORKING_DIRECTORY ${build_dir}
) )
add_test( add_test(
NAME cmake_package/install NAME ${prefix}/install
COMMAND ${CMAKE_COMMAND} --build ${build_dir} --target 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( 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} 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} 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( add_test(
NAME cmake_package/use_evmc/build NAME ${prefix}/use_evmc/build
COMMAND ${CMAKE_COMMAND} --build ${use_evmc_build_dir} 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( 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} 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} 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( add_test(
NAME cmake_package/use_instructions/build NAME ${prefix}/use_instructions/build
COMMAND ${CMAKE_COMMAND} --build ${use_instructions_build_dir} 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)

View File

@ -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) 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 ..) 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/)

View File

@ -12,26 +12,28 @@ set_source_files_properties(vmtester.cpp PROPERTIES COMPILE_DEFINITIONS PROJECT_
install(TARGETS evmc-vmtester RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) install(TARGETS evmc-vmtester RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
add_test(NAME vmtester/examplevm COMMAND evmc-vmtester $<TARGET_FILE:evmc-example-vm>) set(prefix ${PROJECT_NAME}/vmtester)
add_test(NAME vmtester/example_precompiles_vm COMMAND evmc-vmtester $<TARGET_FILE:evmc-example-precompiles-vm>)
add_test(NAME vmtester/help COMMAND evmc-vmtester --version --help) add_test(NAME ${prefix}/examplevm COMMAND evmc-vmtester $<TARGET_FILE:evmc-example-vm>)
set_tests_properties(vmtester/help PROPERTIES PASS_REGULAR_EXPRESSION "Usage:") add_test(NAME ${prefix}/example_precompiles_vm COMMAND evmc-vmtester $<TARGET_FILE:evmc-example-precompiles-vm>)
add_test(NAME vmtester/nonexistingvm COMMAND evmc-vmtester nonexistingvm) add_test(NAME ${prefix}/help COMMAND evmc-vmtester --version --help)
set_tests_properties(vmtester/nonexistingvm PROPERTIES PASS_REGULAR_EXPRESSION "[Cc]annot open") set_tests_properties(${prefix}/help PROPERTIES PASS_REGULAR_EXPRESSION "Usage:")
add_test(NAME vmtester/noarg COMMAND evmc-vmtester) add_test(NAME ${prefix}/nonexistingvm COMMAND evmc-vmtester nonexistingvm)
set_tests_properties(vmtester/noarg PROPERTIES PASS_REGULAR_EXPRESSION "is required") set_tests_properties(${prefix}/nonexistingvm PROPERTIES PASS_REGULAR_EXPRESSION "[Cc]annot open")
add_test(NAME vmtester/too-many-args COMMAND evmc-vmtester a b) add_test(NAME ${prefix}/noarg COMMAND evmc-vmtester)
set_tests_properties(vmtester/too-many-args PROPERTIES PASS_REGULAR_EXPRESSION "Unexpected") set_tests_properties(${prefix}/noarg PROPERTIES PASS_REGULAR_EXPRESSION "is required")
add_test(NAME vmtester/version COMMAND evmc-vmtester --version) add_test(NAME ${prefix}/too-many-args COMMAND evmc-vmtester a b)
set_tests_properties(vmtester/version PROPERTIES PASS_REGULAR_EXPRESSION ${PROJECT_VERSION}) set_tests_properties(${prefix}/too-many-args PROPERTIES PASS_REGULAR_EXPRESSION "Unexpected")
add_test(NAME vmtester/unknown-option COMMAND evmc-vmtester --verbose) add_test(NAME ${prefix}/version COMMAND evmc-vmtester --version)
set_tests_properties(vmtester/unknown-option PROPERTIES PASS_REGULAR_EXPRESSION "Unknown") set_tests_properties(${prefix}/version PROPERTIES PASS_REGULAR_EXPRESSION ${PROJECT_VERSION})
add_test(NAME vmtester/option-long-prefix COMMAND evmc-vmtester ---) add_test(NAME ${prefix}/unknown-option COMMAND evmc-vmtester --verbose)
set_tests_properties(vmtester/option-long-prefix PROPERTIES PASS_REGULAR_EXPRESSION "Unknown") 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")