Add ctests for vmtester

This commit is contained in:
Paweł Bylica 2018-04-11 17:36:54 +02:00
parent 9c239da9bf
commit f1fcb37fbe
No known key found for this signature in database
GPG Key ID: 7A0C037434FE77EF
2 changed files with 26 additions and 0 deletions

View File

@ -28,6 +28,7 @@ target_include_directories(evmc INTERFACE include)
option(EVMC_BUILD_TESTS "Build EVMC tests and test tools" OFF)
if(EVMC_BUILD_TESTS)
enable_testing()
add_subdirectory(test)
endif()

View File

@ -20,3 +20,28 @@ target_link_libraries(
Boost::system
${CMAKE_DL_LIBS}
)
add_test(NAME vmtester-help
COMMAND vmtester --help
)
set_tests_properties(vmtester-help PROPERTIES
PASS_REGULAR_EXPRESSION "Options:"
)
add_test(NAME vmtester-nonexistingvm
COMMAND vmtester nonexistingvm
)
set_tests_properties(vmtester-nonexistingvm PROPERTIES
WILL_FAIL TRUE
FAIL_REGULAR_EXPRESSION "no such file"
)
add_test(NAME vmtester-novm
COMMAND vmtester
)
set_tests_properties(vmtester-novm PROPERTIES
WILL_FAIL TRUE
FAIL_REGULAR_EXPRESSION "required but missing"
)
# TODO: Add test for `vmtester examplevm.so`