Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Not building test-contracts by default #6728

Merged
merged 5 commits into from
Feb 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions unittests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,31 @@ find_package( Gperftools QUIET )

### Build contracts with cdt if available
include(ExternalProject)
# if no cdt root is given use default path
if(EOSIO_CDT_ROOT STREQUAL "" OR NOT EOSIO_CDT_ROOT)
set(EOSIO_WASM_OLD_BEHAVIOR "Off")
find_package(eosio.cdt)
endif()

if (eosio.cdt_FOUND)
if( EOSIO_COMPILE_TEST_CONTRACTS )
set(EOSIO_WASM_OLD_BEHAVIOR "Off")
find_package(eosio.cdt REQUIRED)

message( STATUS "Building contracts in directory `eos/unittests/test-contracts/`" )
ExternalProject_Add(
test_contracts_project
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/test-contracts
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/test-contracts
CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=${EOSIO_CDT_ROOT}/lib/cmake/eosio.cdt/EosioWasmToolchain.cmake -DBoost_INCLUDE_DIRS=${Boost_INCLUDE_DIRS}
CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=${EOSIO_CDT_ROOT}/lib/cmake/eosio.cdt/EosioWasmToolchain.cmake -DBoost_INCLUDE_DIRS=${Boost_INCLUDE_DIRS} -DEOSIO_COMPILE_TEST_CONTRACTS=${EOSIO_COMPILE_TEST_CONTRACTS}
UPDATE_COMMAND ""
PATCH_COMMAND ""
TEST_COMMAND ""
INSTALL_COMMAND ""
BUILD_ALWAYS 1
)
else()
add_subdirectory(test-contracts)
message( STATUS "Not building contracts in directory `eos/unittests/test-contracts/`" )
add_subdirectory(test-contracts)
endif()

if( GPERFTOOLS_FOUND )
message( STATUS "Found gperftools; compiling tests with TCMalloc")
list( APPEND PLATFORM_SPECIFIC_LIBS tcmalloc )
message( STATUS "Found gperftools; compiling tests with TCMalloc" )
list( APPEND PLATFORM_SPECIFIC_LIBS tcmalloc )
endif()

find_package(LLVM 4.0 REQUIRED CONFIG)
Expand Down
8 changes: 5 additions & 3 deletions unittests/test-contracts/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
set(EOSIO_WASM_OLD_BEHAVIOR "Off")
find_package( eosio.cdt )
if( EOSIO_COMPILE_TEST_CONTRACTS )
set(EOSIO_WASM_OLD_BEHAVIOR "Off")
find_package( eosio.cdt REQUIRED )
endif()

add_subdirectory( asserter )
add_subdirectory( deferred_test )
Expand All @@ -11,7 +13,7 @@ add_subdirectory( proxy )
add_subdirectory( snapshot_test )
add_subdirectory( test.inline )
add_subdirectory( test_api )
add_subdirectory( test_api_mem )
add_subdirectory( test_api_db )
add_subdirectory( test_api_mem )
add_subdirectory( test_api_multi_index )
add_subdirectory( test_ram_limit )
8 changes: 4 additions & 4 deletions unittests/test-contracts/asserter/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
if( ${eosio.cdt_FOUND} )
add_executable( asserter asserter asserter.cpp )
target_include_directories(asserter PUBLIC ${CMAKE_CURRENT_SOURCE}/../)
if( EOSIO_COMPILE_TEST_CONTRACTS )
add_executable( asserter asserter asserter.cpp )
target_include_directories(asserter PUBLIC ${CMAKE_CURRENT_SOURCE}/../)
else()
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/asserter.wasm ${CMAKE_CURRENT_BINARY_DIR}/asserter.wasm COPYONLY )
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/asserter.wasm ${CMAKE_CURRENT_BINARY_DIR}/asserter.wasm COPYONLY )
endif()

configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/asserter.abi ${CMAKE_CURRENT_BINARY_DIR}/asserter.abi COPYONLY )
8 changes: 4 additions & 4 deletions unittests/test-contracts/deferred_test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
if( ${eosio.cdt_FOUND} )
add_contract( deferred_test deferred_test deferred_test.cpp )
if( EOSIO_COMPILE_TEST_CONTRACTS )
add_contract( deferred_test deferred_test deferred_test.cpp )
else()
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/deferred_test.wasm ${CMAKE_CURRENT_BINARY_DIR}/deferred_test.wasm COPYONLY )
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/deferred_test.abi ${CMAKE_CURRENT_BINARY_DIR}/deferred_test.abi COPYONLY )
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/deferred_test.wasm ${CMAKE_CURRENT_BINARY_DIR}/deferred_test.wasm COPYONLY )
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/deferred_test.abi ${CMAKE_CURRENT_BINARY_DIR}/deferred_test.abi COPYONLY )
endif()
8 changes: 4 additions & 4 deletions unittests/test-contracts/integration_test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
if( ${eosio.cdt_FOUND} )
add_contract( integration_test integration_test integration_test.cpp )
if( EOSIO_COMPILE_TEST_CONTRACTS )
add_contract( integration_test integration_test integration_test.cpp )
else()
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/integration_test.wasm ${CMAKE_CURRENT_BINARY_DIR}/integration_test.wasm COPYONLY )
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/integration_test.abi ${CMAKE_CURRENT_BINARY_DIR}/integration_test.abi COPYONLY )
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/integration_test.wasm ${CMAKE_CURRENT_BINARY_DIR}/integration_test.wasm COPYONLY )
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/integration_test.abi ${CMAKE_CURRENT_BINARY_DIR}/integration_test.abi COPYONLY )
endif()
8 changes: 4 additions & 4 deletions unittests/test-contracts/multi_index_test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
if( ${eosio.cdt_FOUND} )
add_contract( snapshot_test multi_index_test multi_index_test.cpp )
if( EOSIO_COMPILE_TEST_CONTRACTS )
add_contract( snapshot_test multi_index_test multi_index_test.cpp )
else()
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/multi_index_test.wasm ${CMAKE_CURRENT_BINARY_DIR}/multi_index_test.wasm COPYONLY )
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/multi_index_test.abi ${CMAKE_CURRENT_BINARY_DIR}/multi_index_test.abi COPYONLY )
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/multi_index_test.wasm ${CMAKE_CURRENT_BINARY_DIR}/multi_index_test.wasm COPYONLY )
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/multi_index_test.abi ${CMAKE_CURRENT_BINARY_DIR}/multi_index_test.abi COPYONLY )
endif()
8 changes: 4 additions & 4 deletions unittests/test-contracts/noop/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
if( ${eosio.cdt_FOUND} )
add_contract( noop noop noop.cpp )
if( EOSIO_COMPILE_TEST_CONTRACTS )
add_contract( noop noop noop.cpp )
else()
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/noop.wasm ${CMAKE_CURRENT_BINARY_DIR}/noop.wasm COPYONLY )
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/noop.abi ${CMAKE_CURRENT_BINARY_DIR}/noop.abi COPYONLY )
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/noop.wasm ${CMAKE_CURRENT_BINARY_DIR}/noop.wasm COPYONLY )
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/noop.abi ${CMAKE_CURRENT_BINARY_DIR}/noop.abi COPYONLY )
endif()
8 changes: 4 additions & 4 deletions unittests/test-contracts/payloadless/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
if( ${eosio.cdt_FOUND} )
add_contract( payloadless payloadless payloadless.cpp )
if( EOSIO_COMPILE_TEST_CONTRACTS )
add_contract( payloadless payloadless payloadless.cpp )
else()
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/payloadless.wasm ${CMAKE_CURRENT_BINARY_DIR}/payloadless.wasm COPYONLY )
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/payloadless.abi ${CMAKE_CURRENT_BINARY_DIR}/payloadless.abi COPYONLY )
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/payloadless.wasm ${CMAKE_CURRENT_BINARY_DIR}/payloadless.wasm COPYONLY )
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/payloadless.abi ${CMAKE_CURRENT_BINARY_DIR}/payloadless.abi COPYONLY )
endif()
6 changes: 3 additions & 3 deletions unittests/test-contracts/proxy/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
if( ${eosio.cdt_FOUND} )
add_executable( proxy proxy proxy.cpp )
if( EOSIO_COMPILE_TEST_CONTRACTS )
add_executable( proxy proxy proxy.cpp )
else()
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/proxy.wasm ${CMAKE_CURRENT_BINARY_DIR}/proxy.wasm COPYONLY )
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/proxy.wasm ${CMAKE_CURRENT_BINARY_DIR}/proxy.wasm COPYONLY )
endif()

configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/proxy.abi ${CMAKE_CURRENT_BINARY_DIR}/proxy.abi COPYONLY )
8 changes: 4 additions & 4 deletions unittests/test-contracts/snapshot_test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
if( ${eosio.cdt_FOUND} )
add_contract( snapshot_test snapshot_test snapshot_test.cpp )
if( EOSIO_COMPILE_TEST_CONTRACTS )
add_contract( snapshot_test snapshot_test snapshot_test.cpp )
else()
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/snapshot_test.wasm ${CMAKE_CURRENT_BINARY_DIR}/snapshot_test.wasm COPYONLY )
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/snapshot_test.abi ${CMAKE_CURRENT_BINARY_DIR}/snapshot_test.abi COPYONLY )
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/snapshot_test.wasm ${CMAKE_CURRENT_BINARY_DIR}/snapshot_test.wasm COPYONLY )
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/snapshot_test.abi ${CMAKE_CURRENT_BINARY_DIR}/snapshot_test.abi COPYONLY )
endif()
8 changes: 4 additions & 4 deletions unittests/test-contracts/test.inline/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
if( ${eosio.cdt_FOUND} )
add_contract( test.inline test.inline test.inline.cpp )
if( EOSIO_COMPILE_TEST_CONTRACTS )
add_contract( test.inline test.inline test.inline.cpp )
else()
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/test.inline.wasm ${CMAKE_CURRENT_BINARY_DIR}/test.inline.wasm COPYONLY )
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/test.inline.abi ${CMAKE_CURRENT_BINARY_DIR}/test.inline.abi COPYONLY )
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/test.inline.wasm ${CMAKE_CURRENT_BINARY_DIR}/test.inline.wasm COPYONLY )
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/test.inline.abi ${CMAKE_CURRENT_BINARY_DIR}/test.inline.abi COPYONLY )
endif()
6 changes: 3 additions & 3 deletions unittests/test-contracts/test_api/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
if( ${eosio.cdt_FOUND} )
add_executable( test_api test_api.cpp )
if( EOSIO_COMPILE_TEST_CONTRACTS )
add_executable( test_api test_api.cpp )
else()
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/test_api.wasm ${CMAKE_CURRENT_BINARY_DIR}/test_api.wasm COPYONLY )
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/test_api.wasm ${CMAKE_CURRENT_BINARY_DIR}/test_api.wasm COPYONLY )
endif()
6 changes: 3 additions & 3 deletions unittests/test-contracts/test_api_db/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
if( ${eosio.cdt_FOUND} )
add_executable( test_api_db test_api_db.cpp )
if( EOSIO_COMPILE_TEST_CONTRACTS )
add_executable( test_api_db test_api_db.cpp )
else()
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/test_api_db.wasm ${CMAKE_CURRENT_BINARY_DIR}/test_api_db.wasm COPYONLY )
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/test_api_db.wasm ${CMAKE_CURRENT_BINARY_DIR}/test_api_db.wasm COPYONLY )
endif()
6 changes: 3 additions & 3 deletions unittests/test-contracts/test_api_mem/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
if( ${eosio.cdt_FOUND} )
add_executable( test_api_mem test_api_mem.cpp )
if( EOSIO_COMPILE_TEST_CONTRACTS )
add_executable( test_api_mem test_api_mem.cpp )
else()
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/test_api_mem.wasm ${CMAKE_CURRENT_BINARY_DIR}/test_api_mem.wasm COPYONLY )
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/test_api_mem.wasm ${CMAKE_CURRENT_BINARY_DIR}/test_api_mem.wasm COPYONLY )
endif()
6 changes: 3 additions & 3 deletions unittests/test-contracts/test_api_multi_index/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
if( ${eosio.cdt_FOUND} )
if( EOSIO_COMPILE_TEST_CONTRACTS )
include_directories( ${Boost_INCLUDE_DIRS} )
add_executable( test_api_multi_index test_api_multi_index.cpp )
add_executable( test_api_multi_index test_api_multi_index.cpp )
else()
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/test_api_multi_index.wasm ${CMAKE_CURRENT_BINARY_DIR}/test_api_multi_index.wasm COPYONLY )
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/test_api_multi_index.wasm ${CMAKE_CURRENT_BINARY_DIR}/test_api_multi_index.wasm COPYONLY )
endif()
2 changes: 1 addition & 1 deletion unittests/test-contracts/test_ram_limit/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if( ${eosio.cdt_FOUND} )
if( EOSIO_COMPILE_TEST_CONTRACTS )
message(STATUS "Not building test_ram_limit, read README.txt in eos/unittests/test-contracts/test_ram_limit")
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/test_ram_limit.wasm ${CMAKE_CURRENT_BINARY_DIR}/test_ram_limit.wasm COPYONLY )
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/test_ram_limit.abi ${CMAKE_CURRENT_BINARY_DIR}/test_ram_limit.abi COPYONLY )
Expand Down