diff --git a/tests/common/database_fixture.cpp b/tests/common/database_fixture.cpp index e671aba4..676c53b5 100644 --- a/tests/common/database_fixture.cpp +++ b/tests/common/database_fixture.cpp @@ -46,6 +46,8 @@ using namespace graphene::chain::test; +uint32_t GRAPHENE_TESTING_GENESIS_TIMESTAMP = 1431700000; + namespace graphene { namespace chain { using std::cout; diff --git a/tests/common/database_fixture.hpp b/tests/common/database_fixture.hpp index 4f38c603..9bb218a9 100644 --- a/tests/common/database_fixture.hpp +++ b/tests/common/database_fixture.hpp @@ -29,7 +29,7 @@ using namespace graphene::db; -#define GRAPHENE_TESTING_GENESIS_TIMESTAMP (1431700000) +extern uint32_t GRAPHENE_TESTING_GENESIS_TIMESTAMP; #define PUSH_TX \ graphene::chain::test::_push_transaction diff --git a/tests/tests/main.cpp b/tests/tests/main.cpp index c3ce0631..906bbca0 100644 --- a/tests/tests/main.cpp +++ b/tests/tests/main.cpp @@ -23,8 +23,16 @@ #include #include +extern uint32_t GRAPHENE_TESTING_GENESIS_TIMESTAMP; + boost::unit_test::test_suite* init_unit_test_suite(int argc, char* argv[]) { std::srand(time(NULL)); std::cout << "Random number generator seeded to " << time(NULL) << std::endl; + const char* genesis_timestamp_str = getenv("GRAPHENE_TESTING_GENESIS_TIMESTAMP"); + if( genesis_timestamp_str != nullptr ) + { + GRAPHENE_TESTING_GENESIS_TIMESTAMP = std::stoul( genesis_timestamp_str ); + } + std::cout << "GRAPHENE_TESTING_GENESIS_TIMESTAMP is " << GRAPHENE_TESTING_GENESIS_TIMESTAMP << std::endl; return nullptr; }