2018-06-08 10:44:33 +00:00
|
|
|
# EVMC: Ethereum Client-VM Connector API.
|
2019-04-24 14:12:13 +00:00
|
|
|
# Copyright 2018-2019 The EVMC Authors.
|
2019-03-13 18:31:50 +00:00
|
|
|
# Licensed under the Apache License, Version 2.0.
|
|
|
|
|
2019-04-02 10:59:49 +00:00
|
|
|
include(GoogleTest)
|
|
|
|
|
2019-11-27 11:34:28 +00:00
|
|
|
hunter_add_package(GTest)
|
|
|
|
find_package(GTest CONFIG REQUIRED)
|
|
|
|
|
|
|
|
# Disable support for std::tr1::tuple in GTest. This causes problems in Visual Studio 2015.
|
|
|
|
set_target_properties(GTest::gtest PROPERTIES INTERFACE_COMPILE_DEFINITIONS GTEST_HAS_TR1_TUPLE=0)
|
|
|
|
|
2019-03-13 18:31:50 +00:00
|
|
|
add_library(loader-mocked STATIC ${PROJECT_SOURCE_DIR}/lib/loader/loader.c)
|
|
|
|
target_link_libraries(loader-mocked PRIVATE evmc)
|
|
|
|
target_compile_definitions(loader-mocked PRIVATE EVMC_LOADER_MOCK=1)
|
2018-06-08 10:44:33 +00:00
|
|
|
|
|
|
|
add_executable(
|
2019-04-02 10:36:08 +00:00
|
|
|
evmc-unittests
|
2019-03-13 18:31:50 +00:00
|
|
|
loader_mock.h
|
2018-11-26 15:52:36 +00:00
|
|
|
test_cpp.cpp
|
2018-09-08 14:08:37 +00:00
|
|
|
test_helpers.cpp
|
2018-06-08 10:44:33 +00:00
|
|
|
test_instructions.cpp
|
2018-07-04 23:10:33 +00:00
|
|
|
test_loader.cpp
|
2018-06-08 10:44:33 +00:00
|
|
|
)
|
|
|
|
|
2019-11-05 11:52:40 +00:00
|
|
|
target_link_libraries(
|
|
|
|
evmc-unittests
|
|
|
|
PRIVATE
|
|
|
|
loader-mocked
|
|
|
|
evmc::example-vm-static
|
2019-11-05 12:11:45 +00:00
|
|
|
evmc::example-precompiles-vm-static
|
2019-11-27 11:34:28 +00:00
|
|
|
evmc::instructions
|
2019-11-05 11:52:40 +00:00
|
|
|
GTest::gtest_main
|
|
|
|
)
|
2019-04-02 10:36:08 +00:00
|
|
|
set_target_properties(evmc-unittests PROPERTIES RUNTIME_OUTPUT_DIRECTORY ..)
|
2019-04-02 10:59:49 +00:00
|
|
|
|
2019-05-15 12:45:10 +00:00
|
|
|
gtest_add_tests(TARGET evmc-unittests TEST_PREFIX ${PROJECT_NAME}/unittests/)
|