diff options
author | CJentzsch <jentzsch.software@gmail.com> | 2015-04-21 05:17:19 +0800 |
---|---|---|
committer | CJentzsch <jentzsch.software@gmail.com> | 2015-04-21 05:17:19 +0800 |
commit | 8f8eb359741efe6cba7d27c9f55212492987afac (patch) | |
tree | a2d3533b5f60f1ab6515d07aca5730324ee723eb | |
parent | 6a3bb95473e1cf77884078b0bd2c33218882f0ee (diff) | |
download | dexon-solidity-8f8eb359741efe6cba7d27c9f55212492987afac.tar.gz dexon-solidity-8f8eb359741efe6cba7d27c9f55212492987afac.tar.zst dexon-solidity-8f8eb359741efe6cba7d27c9f55212492987afac.zip |
fixes
-rw-r--r-- | CMakeLists.txt | 36 | ||||
-rw-r--r-- | TestHelper.cpp | 2 |
2 files changed, 15 insertions, 23 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index bbb35123..b46ab06e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,8 +17,6 @@ macro (add_sources) endif() endmacro() -#add_sources(boostTest.cpp) - add_subdirectory(fuzzTesting) add_subdirectory(libdevcore) add_subdirectory(libdevcrypto) @@ -32,14 +30,10 @@ add_subdirectory(libsolidity) add_subdirectory(libweb3jsonrpc) add_subdirectory(libwhisper) -message(STATUS "${SRC}") -message("AHA") - set(SRC_LIST ${SRC_LIST} ${SRC}) -message(STATUS "${SRC_LIST}") if (NOT JSONRPC) - list(REMOVE_ITEM SRC_LIST "./AccountHolder.cpp") + list(REMOVE_ITEM SRC_LIST "libweb3jsonrpc/./AccountHolder.cpp") endif() include_directories(BEFORE ${JSONCPP_INCLUDE_DIRS}) @@ -49,20 +43,20 @@ include_directories(${CRYPTOPP_INCLUDE_DIRS}) include_directories(${JSON_RPC_CPP_INCLUDE_DIRS}) # 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 testeth -t ${TestSuite}/${TestCase}) -# endif(test MATCHES "^SUITE .*") -# endforeach(test_raw) -#endforeach(file) +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 testeth -t ${TestSuite}/${TestCase}) + endif(test MATCHES "^SUITE .*") + endforeach(test_raw) +endforeach(file) file(GLOB HEADERS "*.h") add_executable(testeth ${SRC_LIST} ${HEADERS}) diff --git a/TestHelper.cpp b/TestHelper.cpp index 3d085682..1419afde 100644 --- a/TestHelper.cpp +++ b/TestHelper.cpp @@ -602,10 +602,8 @@ void executeTests(const string& _name, const string& _testPathAppendix, const bo try { cnote << "Populating tests..."; - cout << "boost::filesystem::current_path(): " << boost::filesystem::current_path().string() << endl; json_spirit::mValue v; boost::filesystem::path p(__FILE__); - boost::filesystem::path dir = p.parent_path(); string s = asString(dev::contents(_pathToFiller.string() + "/" + _name + "Filler.json")); BOOST_REQUIRE_MESSAGE(s.length() > 0, "Contents of " + _pathToFiller.string() + "/" + _name + "Filler.json is empty."); json_spirit::read_string(s, v); |