Merge bitcoin/bitcoin#30952: test: Use shell builtins in run_command test case
Some checks are pending
CI / test each commit (push) Waiting to run
CI / macOS 14 native, arm64, no depends, sqlite only, gui (push) Waiting to run
CI / Win64 native, VS 2022 (push) Waiting to run
CI / ASan + LSan + UBSan + integer, no depends, USDT (push) Waiting to run

7bd3ee62f6 test: Use shell builtins in run_command test case (Ava Chow)

Pull request description:

  Uses the [suggested command](https://github.com/bitcoin/bitcoin/issues/30938#issuecomment-2363906135)

  Fixes #30938

ACKs for top commit:
  maflcko:
    review ACK 7bd3ee62f6
  hebasto:
    ACK 7bd3ee62f6.

Tree-SHA512: 683b15cafaf0103eeadf872ea6ce9a7d884b2605d3dcf4e66b0173cdb149c24965e7c5fa62aaddf2ac55df3f449aeb787176992c96cfee5d0b86621259e1dfe9
This commit is contained in:
merge-script 2024-09-24 16:37:44 +01:00
commit 393f323bd6
No known key found for this signature in database
GPG key ID: 2EEB9F5CC09526C1

View file

@ -47,7 +47,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());