From 8926882b60e6fcae9832ee7368fa6d7012108387 Mon Sep 17 00:00:00 2001 From: Carlos R.F Date: Aug 20 2023 20:47:51 +0000 Subject: perf:capture stderr, simplify report test Signed-off-by: Carlos R.F --- diff --git a/tests/p_perf/perf_tests.sh b/tests/p_perf/perf_tests.sh index da603cb..2db8f35 100755 --- a/tests/p_perf/perf_tests.sh +++ b/tests/p_perf/perf_tests.sh @@ -6,13 +6,17 @@ t_Log "Running $0 - perf tests" tests_in_order=( "perf version" "perf record -F 49 -a -g -- sleep 1" - "perf report --stdio " + "perf report --stats" ) +output_file=$(mktemp) +trap "rm -f ${output_file}" EXIT + for cmd in "${tests_in_order[@]}"; do t_Log "Running $0 - perf test: ${cmd}" - if ! eval "${cmd}" > /dev/null 2>&1; then - t_Log "FAIL: $0: perf test: ${cmd}" + if ! eval "${cmd}" > ${output_file} 2>&1; then + t_Log "FAIL: $0: ${cmd}" + cat ${output_file} exit 1 else t_Log "PASS: $0: perf test: ${cmd}"