Changeset View
Changeset View
Standalone View
Standalone View
src/test/test_bitcoin_main.cpp
// Copyright (c) 2011-2016 The Bitcoin Core developers | // Copyright (c) 2011-2016 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#define BOOST_TEST_MODULE Bitcoin Test Suite | #define BOOST_TEST_MODULE Bitcoin ABC unit tests | ||||
#include <banman.h> | #include <banman.h> | ||||
#include <net.h> | #include <net.h> | ||||
#include <util/system.h> | #include <util/system.h> | ||||
#include <boost/test/unit_test.hpp> | #include <boost/test/unit_test.hpp> | ||||
#include <memory> | #include <memory> | ||||
Show All 18 Lines | |||||
/* | /* | ||||
* Global fixture for passing custom arguments, and clearing them all after each | * Global fixture for passing custom arguments, and clearing them all after each | ||||
* test case. | * test case. | ||||
*/ | */ | ||||
struct CustomArgumentsFixture { | struct CustomArgumentsFixture { | ||||
std::string error; | std::string error; | ||||
CustomArgumentsFixture() { | CustomArgumentsFixture() { | ||||
std::set<std::string> testArgs = { | const std::string nextUpgradeFlag = "-phononactivationtime"; | ||||
"-phononactivationtime", | |||||
const std::set<std::string> testArgs = { | |||||
nextUpgradeFlag, | |||||
}; | }; | ||||
for (const auto &arg : testArgs) { | for (const auto &arg : testArgs) { | ||||
gArgs.AddArg(arg, "", false, OptionsCategory::HIDDEN); | gArgs.AddArg(arg, "", false, OptionsCategory::HIDDEN); | ||||
} | } | ||||
const auto &master_test_suite = utf::master_test_suite(); | auto &master_test_suite = utf::master_test_suite(); | ||||
if (!gArgs.ParseParameters(master_test_suite.argc, | if (!gArgs.ParseParameters(master_test_suite.argc, | ||||
master_test_suite.argv, error)) { | master_test_suite.argv, error)) { | ||||
throw utf::setup_error(error); | throw utf::setup_error(error); | ||||
} | } | ||||
// If the next upgrade is activated, append it to the test suite name | |||||
if (gArgs.IsArgSet(nextUpgradeFlag)) { | |||||
master_test_suite.p_name.value += | |||||
" with the next upgrade activated"; | |||||
jasonbcox: This can be more informative: `" with the next upgrade activated: " + nextUpgradeFlag` | |||||
FabienAuthorUnsubmitted Done Inline ActionsIt can even be a custom argument in the spirit of D4943, but I needed something "quick and dirty" for challenging Teamcity first. Fabien: It can even be a custom argument in the spirit of D4943, but I needed something "quick and… | |||||
} | |||||
} | } | ||||
~CustomArgumentsFixture(){}; | ~CustomArgumentsFixture(){}; | ||||
}; | }; | ||||
BOOST_GLOBAL_FIXTURE(CustomArgumentsFixture); | BOOST_GLOBAL_FIXTURE(CustomArgumentsFixture); |
This can be more informative: " with the next upgrade activated: " + nextUpgradeFlag