test: Use shell builtins in run_command test case

Github-Pull: bitcoin/bitcoin#30952
Rebased-From: 7bd3ee62f6
pull/30959/head
Ava Chow 1 month ago
parent 1147e72953
commit e24a25d882
No known key found for this signature in database
GPG Key ID: 17565732E08E5E41

@ -54,7 +54,7 @@ BOOST_AUTO_TEST_CASE(run_command)
}
{
// Return non-zero exit code, with error message for stderr
const std::string command{"python3 -c 'import sys; print(\"err\", file=sys.stderr); sys.exit(2)'"};
const std::string command{"sh -c 'echo err 1>&2 && false'"};
const std::string expected{"err"};
BOOST_CHECK_EXCEPTION(RunCommandParseJSON(command), std::runtime_error, [&](const std::runtime_error& e) {
const std::string what(e.what());

Loading…
Cancel
Save