This commit is contained in:
CJentzsch 2015-04-20 23:17:19 +02:00
parent 6a3bb95473
commit 8f8eb35974
2 changed files with 15 additions and 23 deletions

View File

@ -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})

View File

@ -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);