2018-04-24 12:51:18 +00:00
|
|
|
# EVMC: Ethereum Client-VM Connector API.
|
2019-04-24 14:12:13 +00:00
|
|
|
# Copyright 2018-2019 The EVMC Authors.
|
2019-03-16 22:42:28 +00:00
|
|
|
# Licensed under the Apache License, Version 2.0.
|
2018-04-12 09:01:24 +00:00
|
|
|
|
2018-04-11 13:29:29 +00:00
|
|
|
include(GNUInstallDirs)
|
|
|
|
|
2018-08-30 12:49:20 +00:00
|
|
|
add_executable(evmc-vmtester vmtester.hpp vmtester.cpp tests.cpp)
|
2018-06-21 09:08:32 +00:00
|
|
|
set_target_properties(evmc-vmtester PROPERTIES RUNTIME_OUTPUT_DIRECTORY ..)
|
2019-03-16 22:45:36 +00:00
|
|
|
target_link_libraries(evmc-vmtester PRIVATE evmc loader evmc-example-host GTest::gtest)
|
2019-05-15 12:41:48 +00:00
|
|
|
set_source_files_properties(vmtester.cpp PROPERTIES COMPILE_DEFINITIONS PROJECT_VERSION="${PROJECT_VERSION}")
|
2019-03-16 22:42:28 +00:00
|
|
|
|
2018-06-18 12:00:28 +00:00
|
|
|
|
2018-04-11 13:29:29 +00:00
|
|
|
install(TARGETS evmc-vmtester RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
|
|
|
|
2019-04-02 11:31:05 +00:00
|
|
|
add_test(NAME vmtester/examplevm COMMAND evmc-vmtester $<TARGET_FILE:evmc-example-vm>)
|
2019-05-09 05:55:04 +00:00
|
|
|
add_test(NAME vmtester/example_precompiles_vm COMMAND evmc-vmtester $<TARGET_FILE:evmc-example-precompiles-vm>)
|
2019-04-02 11:31:05 +00:00
|
|
|
|
2019-04-02 11:32:20 +00:00
|
|
|
add_test(NAME vmtester/help COMMAND evmc-vmtester --version --help)
|
|
|
|
set_tests_properties(vmtester/help PROPERTIES PASS_REGULAR_EXPRESSION "Usage:")
|
2019-03-17 21:05:59 +00:00
|
|
|
|
2019-04-02 11:32:20 +00:00
|
|
|
add_test(NAME vmtester/nonexistingvm COMMAND evmc-vmtester nonexistingvm)
|
2019-04-16 16:04:42 +00:00
|
|
|
set_tests_properties(vmtester/nonexistingvm PROPERTIES PASS_REGULAR_EXPRESSION "[Cc]annot open")
|
2019-03-17 21:05:59 +00:00
|
|
|
|
2019-04-02 11:32:20 +00:00
|
|
|
add_test(NAME vmtester/noarg COMMAND evmc-vmtester)
|
|
|
|
set_tests_properties(vmtester/noarg PROPERTIES PASS_REGULAR_EXPRESSION "is required")
|
2019-03-17 21:05:59 +00:00
|
|
|
|
2019-04-02 11:32:20 +00:00
|
|
|
add_test(NAME vmtester/too-many-args COMMAND evmc-vmtester a b)
|
|
|
|
set_tests_properties(vmtester/too-many-args PROPERTIES PASS_REGULAR_EXPRESSION "Unexpected")
|
2019-03-17 21:05:59 +00:00
|
|
|
|
2019-04-02 11:32:20 +00:00
|
|
|
add_test(NAME vmtester/version COMMAND evmc-vmtester --version)
|
|
|
|
set_tests_properties(vmtester/version PROPERTIES PASS_REGULAR_EXPRESSION ${PROJECT_VERSION})
|
2019-03-17 21:05:59 +00:00
|
|
|
|
2019-04-02 11:32:20 +00:00
|
|
|
add_test(NAME vmtester/unknown-option COMMAND evmc-vmtester --verbose)
|
|
|
|
set_tests_properties(vmtester/unknown-option PROPERTIES PASS_REGULAR_EXPRESSION "Unknown")
|
2019-03-17 21:05:59 +00:00
|
|
|
|
2019-04-02 11:32:20 +00:00
|
|
|
add_test(NAME vmtester/option-long-prefix COMMAND evmc-vmtester ---)
|
|
|
|
set_tests_properties(vmtester/option-long-prefix PROPERTIES PASS_REGULAR_EXPRESSION "Unknown")
|