mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
use ETHEREUM_TEST_PATH in all tests
This commit is contained in:
parent
b69cc9815f
commit
fb21574455
13
genesis.cpp
13
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);
|
||||
|
||||
|
@ -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())
|
||||
|
13
rlp.cpp
13
rlp.cpp
@ -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);
|
||||
|
13
trie.cpp
13
trie.cpp
@ -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())
|
||||
|
Loading…
Reference in New Issue
Block a user