Changeset View
Changeset View
Standalone View
Standalone View
cmake/utils/log-and-print-on-failure.sh
- This file was moved from cmake/utils/test_wrapper.sh.
#!/bin/sh | #!/bin/sh | ||||
# USAGE test_wrapper.sh executable log [args] | # USAGE log-and-print-on-failure.sh log executable [args] | ||||
# Run the <executable> with supplied <args> arguments. | # Run the <executable> with supplied <args> arguments. | ||||
# The stdout and stderr outputs are redirected to the <log> file, which is only | # The stdout and stderr outputs are redirected to the <log> file, which is only | ||||
# printed on error. | # printed on error. | ||||
LOG="$1" | LOG="$1" | ||||
shift 1 | shift 1 | ||||
"$@" > "${LOG}" 2>&1 || (cat "${LOG}" && exit 1) | "$@" > "${LOG}" 2>&1 || (cat "${LOG}" && exit 1) |