forked from Bitcoin-ABC/bitcoin-abc
-
Notifications
You must be signed in to change notification settings - Fork 28
/
main.cpp
45 lines (33 loc) · 1.27 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright (c) 2011-2016 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#define BOOST_TEST_MODULE Bitcoin Cash Node unit tests
#include <util/system.h>
#include <boost/test/unit_test.hpp>
namespace utf = boost::unit_test::framework;
/*
* Global fixture for passing custom arguments, and clearing them all after each
* test case.
*/
struct CustomArgumentsFixture {
std::string error;
CustomArgumentsFixture() {
const std::string testsuitename = "-testsuitename";
const std::set<std::string> testArgs = {
testsuitename,
"-axionactivationtime",
};
for (const auto &arg : testArgs) {
gArgs.AddArg(arg, "", false, OptionsCategory::HIDDEN);
}
auto &master_test_suite = utf::master_test_suite();
if (!gArgs.ParseParameters(master_test_suite.argc,
master_test_suite.argv, error)) {
throw utf::setup_error(error);
}
master_test_suite.p_name.value =
gArgs.GetArg(testsuitename, master_test_suite.p_name.value);
}
~CustomArgumentsFixture(){};
};
BOOST_GLOBAL_FIXTURE(CustomArgumentsFixture);