diff options
author | Christoph Jentzsch <jentzsch.software@gmail.com> | 2014-10-28 00:04:18 +0800 |
---|---|---|
committer | Christoph Jentzsch <jentzsch.software@gmail.com> | 2014-10-28 00:30:27 +0800 |
commit | 0a3b337be5174d6c6749b5a548690cdd84706b3a (patch) | |
tree | 0185b5d9d2c8a7d5d960e2481c19a4a8ab013927 | |
parent | dba99342ba185c264b5b04ca36b9ac7e5ecd0a56 (diff) | |
download | dexon-solidity-0a3b337be5174d6c6749b5a548690cdd84706b3a.tar.gz dexon-solidity-0a3b337be5174d6c6749b5a548690cdd84706b3a.tar.zst dexon-solidity-0a3b337be5174d6c6749b5a548690cdd84706b3a.zip |
use ETHEREUM_TEST_PATH in all tests
-rw-r--r-- | genesis.cpp | 13 | ||||
-rw-r--r-- | hexPrefix.cpp | 13 | ||||
-rw-r--r-- | rlp.cpp | 13 | ||||
-rw-r--r-- | trie.cpp | 13 |
4 files changed, 48 insertions, 4 deletions
diff --git a/genesis.cpp b/genesis.cpp index 5f17d276..16ffb185 100644 --- a/genesis.cpp +++ b/genesis.cpp @@ -35,9 +35,20 @@ namespace js = json_spirit; BOOST_AUTO_TEST_CASE(genesis_tests) { + const char* ptestPath = getenv("ETHEREUM_TEST_PATH"); + string testPath; + + if (ptestPath == NULL) + { + cnote << " could not find environment variable ETHEREUM_TEST_PATH \n"; + testPath = "../../../tests"; + } + else + testPath = ptestPath; + cnote << "Testing Genesis block..."; js::mValue v; - string s = asString(contents("../../../tests/genesishashestest.json")); + string s = asString(contents(testPath + "/genesishashestest.json")); BOOST_REQUIRE_MESSAGE(s.length() > 0, "Contents of 'genesishashestest.json' is empty. Have you cloned the 'tests' repo branch develop?"); js::read_string(s, v); diff --git a/hexPrefix.cpp b/hexPrefix.cpp index fb2fbc82..99207ab9 100644 --- a/hexPrefix.cpp +++ b/hexPrefix.cpp @@ -33,9 +33,20 @@ namespace js = json_spirit; BOOST_AUTO_TEST_CASE(hexPrefix_test) { + const char* ptestPath = getenv("ETHEREUM_TEST_PATH"); + string testPath; + + if (ptestPath == NULL) + { + cnote << " could not find environment variable ETHEREUM_TEST_PATH \n"; + testPath = "../../../tests"; + } + else + testPath = ptestPath; + cnote << "Testing Hex-Prefix-Encode..."; js::mValue v; - string s = asString(contents("../../../tests/hexencodetest.json")); + string s = asString(contents(testPath + "/hexencodetest.json")); BOOST_REQUIRE_MESSAGE(s.length() > 0, "Content from 'hexencodetest.json' is empty. Have you cloned the 'tests' repo branch develop?"); js::read_string(s, v); for (auto& i: v.get_obj()) @@ -61,7 +61,18 @@ namespace dev static void getRLPTestCases(js::mValue& v) { - string s = asString(contents("../../../tests/rlptest.json")); + const char* ptestPath = getenv("ETHEREUM_TEST_PATH"); + string testPath; + + if (ptestPath == NULL) + { + cnote << " could not find environment variable ETHEREUM_TEST_PATH \n"; + testPath = "../../../tests"; + } + else + testPath = ptestPath; + + string s = asString(contents(testPath + "/rlptest.json")); BOOST_REQUIRE_MESSAGE( s.length() > 0, "Contents of 'rlptest.json' is empty. Have you cloned the 'tests' repo branch develop?"); js::read_string(s, v); @@ -49,9 +49,20 @@ static unsigned fac(unsigned _i) BOOST_AUTO_TEST_CASE(trie_tests) { + const char* ptestPath = getenv("ETHEREUM_TEST_PATH"); + string testPath; + + if (ptestPath == NULL) + { + cnote << " could not find environment variable ETHEREUM_TEST_PATH \n"; + testPath = "../../../tests"; + } + else + testPath = ptestPath; + cnote << "Testing Trie..."; js::mValue v; - string s = asString(contents("../../../tests/trietest.json")); + string s = asString(contents(testPath + "/trietest.json")); BOOST_REQUIRE_MESSAGE(s.length() > 0, "Contents of 'trietest.json' is empty. Have you cloned the 'tests' repo branch develop?"); js::read_string(s, v); for (auto& i: v.get_obj()) |