2018-04-24 14:51:18 +02:00
|
|
|
# EVMC: Ethereum Client-VM Connector API.
|
2018-04-12 11:01:24 +02:00
|
|
|
# Copyright 2018 Pawel Bylica.
|
|
|
|
# Licensed under the MIT License. See the LICENSE file.
|
|
|
|
|
2018-04-11 15:29:29 +02:00
|
|
|
include(GNUInstallDirs)
|
|
|
|
|
2018-07-05 15:05:20 +02:00
|
|
|
hunter_add_package(CLI11)
|
|
|
|
find_package(CLI11)
|
2018-04-10 17:11:43 +02:00
|
|
|
|
2018-04-11 17:47:31 +02:00
|
|
|
add_executable(evmc-vmtester vmtester.hpp vmtester.cpp tests.cpp)
|
2018-06-21 11:08:32 +02:00
|
|
|
set_target_properties(evmc-vmtester PROPERTIES RUNTIME_OUTPUT_DIRECTORY ..)
|
2018-04-11 17:37:03 +02:00
|
|
|
|
|
|
|
target_link_libraries(
|
2018-04-11 17:47:31 +02:00
|
|
|
evmc-vmtester
|
2018-04-11 17:37:03 +02:00
|
|
|
PRIVATE
|
|
|
|
evmc
|
2018-07-05 14:51:16 +02:00
|
|
|
loader
|
2018-04-11 17:37:03 +02:00
|
|
|
GTest::gtest
|
2018-07-05 15:05:20 +02:00
|
|
|
CLI11::CLI11
|
2018-04-11 17:37:03 +02:00
|
|
|
)
|
2018-04-11 17:36:54 +02:00
|
|
|
|
2018-06-18 14:00:28 +02:00
|
|
|
set_target_properties(evmc-vmtester PROPERTIES RUNTIME_OUTPUT_DIRECTORY ..)
|
|
|
|
|
2018-04-11 15:29:29 +02:00
|
|
|
install(TARGETS evmc-vmtester RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
|
|
|
|
2018-04-11 17:36:54 +02:00
|
|
|
add_test(NAME vmtester-help
|
2018-04-11 17:47:31 +02:00
|
|
|
COMMAND evmc-vmtester --help
|
2018-04-11 17:36:54 +02:00
|
|
|
)
|
|
|
|
set_tests_properties(vmtester-help PROPERTIES
|
|
|
|
PASS_REGULAR_EXPRESSION "Options:"
|
|
|
|
)
|
|
|
|
|
|
|
|
add_test(NAME vmtester-nonexistingvm
|
2018-04-11 17:47:31 +02:00
|
|
|
COMMAND evmc-vmtester nonexistingvm
|
2018-04-11 17:36:54 +02:00
|
|
|
)
|
|
|
|
set_tests_properties(vmtester-nonexistingvm PROPERTIES
|
|
|
|
WILL_FAIL TRUE
|
|
|
|
FAIL_REGULAR_EXPRESSION "no such file"
|
|
|
|
)
|
|
|
|
|
|
|
|
add_test(NAME vmtester-novm
|
2018-04-11 17:47:31 +02:00
|
|
|
COMMAND evmc-vmtester
|
2018-04-11 17:36:54 +02:00
|
|
|
)
|
|
|
|
set_tests_properties(vmtester-novm PROPERTIES
|
|
|
|
WILL_FAIL TRUE
|
|
|
|
FAIL_REGULAR_EXPRESSION "required but missing"
|
|
|
|
)
|