diff --git a/CMakeLists.txt b/CMakeLists.txt index 30ede11..5fa9d49 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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() diff --git a/test/vmtester/CMakeLists.txt b/test/vmtester/CMakeLists.txt index 0ad475f..728a66c 100644 --- a/test/vmtester/CMakeLists.txt +++ b/test/vmtester/CMakeLists.txt @@ -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`