mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
4ee2114127
This commit is the culmination of several months of work to decouple Solidity from the webthree-umbrella so that it can be developed in parallel with cpp-ethereum (the Ethereum C++ runtime) and so that even for the Solidity unit-tests there is no hard-dependency onto the C++ runtime. The Tests-over-IPC refactoring was a major step in the same process which was already committed. This commit contains the following changes: - A subset of the CMake functionality in webthree-helpers was extracted and tailored for Solidity into ./cmake. Further cleanup is certainly possible. - A subset of the libdevcore functionality in libweb3core was extracted and tailored for Solidity into ./libdevcore. Further cleanup is certainly possible - The gas price constants in EVMSchedule were orphaned into libevmasm. - Some other refactorings and cleanups were made to sever unnecessary EVM dependencies in the Solidity unit-tests. - TravisCI and Appveyor support was added, covering builds and running of the unit-tests (Linux and macOS only for now) - A bug-fix was made to get the Tests-over-IPC running on macOS. - There are still reliability issues in the unit-tests, which need immediate attention. The Travis build has been flipped to run the unit-tests 5 times, to try to flush these out. - The Emscripten automation which was previously in webthree-umbrella was merged into the TravisCI automation here. - The development ZIP deployment step has been commented out, but we will want to read that ONLY for release branch. Further iteration on these changes will definitely be needed, but I feel these have got to sufficient maturity than holding them back further isn't winning us anything. It is go time :-)
36 lines
1.2 KiB
CMake
36 lines
1.2 KiB
CMake
cmake_policy(SET CMP0015 NEW)
|
|
|
|
aux_source_directory(. SRC_LIST)
|
|
aux_source_directory(contracts SRC_LIST)
|
|
aux_source_directory(libsolidity SRC_LIST)
|
|
|
|
get_filename_component(TESTS_DIR "${CMAKE_CURRENT_SOURCE_DIR}" ABSOLUTE)
|
|
|
|
# search for test names and create ctest tests
|
|
enable_testing()
|
|
foreach(file ${SRC_LIST})
|
|
file(STRINGS ${CMAKE_CURRENT_SOURCE_DIR}/${file} test_list_raw REGEX "BOOST_.*TEST_(SUITE|CASE)")
|
|
set(TestSuite "DEFAULT")
|
|
foreach(test_raw ${test_list_raw})
|
|
string(REGEX REPLACE ".*TEST_(SUITE|CASE)\\(([^ ,\\)]*).*" "\\1 \\2" test ${test_raw})
|
|
if(test MATCHES "^SUITE .*")
|
|
string(SUBSTRING ${test} 6 -1 TestSuite)
|
|
elseif(test MATCHES "^CASE .*")
|
|
string(SUBSTRING ${test} 5 -1 TestCase)
|
|
add_test(NAME ${TestSuite}/${TestCase} WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/test COMMAND test -t ${TestSuite}/${TestCase})
|
|
endif(test MATCHES "^SUITE .*")
|
|
endforeach(test_raw)
|
|
endforeach(file)
|
|
|
|
file(GLOB HEADERS "*.h" "*/*.h")
|
|
set(EXECUTABLE soltest)
|
|
eth_simple_add_executable(${EXECUTABLE} ${SRC_LIST} ${HEADERS})
|
|
|
|
eth_use(${EXECUTABLE} REQUIRED Solidity::solidity)
|
|
|
|
include_directories(BEFORE ..)
|
|
target_link_libraries(${EXECUTABLE} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARIES})
|
|
|
|
enable_testing()
|
|
set(CTEST_OUTPUT_ON_FAILURE TRUE)
|