6 #if defined(HAVE_CONFIG_H) 13 #ifdef ENABLE_EXTERNAL_SIGNER 14 #include <boost/process.hpp> 15 #endif // ENABLE_EXTERNAL_SIGNER 17 #include <boost/test/unit_test.hpp> 28 #ifdef ENABLE_EXTERNAL_SIGNER 45 const int expected_error{2};
46 BOOST_CHECK_EXCEPTION(
RunCommandParseJSON(
"invalid_command"), boost::process::process_error, [&](
const boost::process::process_error& e) {
47 BOOST_CHECK(std::string(e.what()).find(
"RunCommandParseJSON error:") == std::string::npos);
54 const std::string
command{
"false"};
56 const std::string what{e.what()};
63 const std::string
command{
"ls nosuchfile"};
64 const std::string expected{
"No such file or directory"};
66 const std::string what(e.what());
68 BOOST_CHECK(what.find(expected) != std::string::npos);
74 const std::string
command{
"echo {"};
86 #endif // ENABLE_EXTERNAL_SIGNER
const UniValue & find_value(std::string_view key) const
BOOST_AUTO_TEST_SUITE_END()
BOOST_CHECK_EXCEPTION predicates to check the specific validation error.
#define BOOST_CHECK_EQUAL(v1, v2)
BOOST_AUTO_TEST_CASE(dummy)
UniValue RunCommandParseJSON(const std::string &str_command, const std::string &str_std_in)
Execute a command which returns JSON, and parse the result.
#define BOOST_CHECK(expr)