mirror of
https://github.com/uutils/sed.git
synced 2026-06-10 16:14:15 -07:00
Handle failed executions
This commit is contained in:
@@ -17,7 +17,11 @@ paste -d , "$1" "$2" |
|
||||
|
||||
awk -F, 'FNR != 1 {
|
||||
printf("%22s ", $3);
|
||||
if ($4 / $12 > 1.1)
|
||||
if (!$4)
|
||||
printf("%12s encountered an error\n", $1);
|
||||
else if (!$12)
|
||||
printf("%12s encountered an error\n", $2);
|
||||
else if ($4 / $12 > 1.1)
|
||||
printf("%12s is %5.1f times faster than %s\n", $2, $4 / $12, $1);
|
||||
else if ($12 / $4 > 1.1)
|
||||
printf("%12s is %5.1f times faster than %s\n", $1, $12 / $4, $2);
|
||||
|
||||
+8
-4
@@ -22,14 +22,18 @@ SCRIPTS=tests/fixtures/sed/script
|
||||
# Run hyperfine with the specified name and command and collect the results.
|
||||
bench_run()
|
||||
{
|
||||
hyperfine --command-name "$1" --warmup 2 --export-csv out.csv "$2"
|
||||
|
||||
# Append the results sans-heading
|
||||
sed 1d out.csv >>"$OUT"
|
||||
if hyperfine --command-name "$1" --warmup 2 --export-csv out.csv "$2" ; then
|
||||
# Output the results sans-heading.
|
||||
sed 1d out.csv >>"$OUT"
|
||||
else
|
||||
# Unable to run; output a named empty record.
|
||||
echo "$1,,,,,,," >>"$OUT"
|
||||
fi
|
||||
|
||||
rm out.csv
|
||||
}
|
||||
|
||||
# Shared heading
|
||||
echo 'command,mean,stddev,median,user,system,min,max' >"$OUT"
|
||||
|
||||
# Short line processing
|
||||
|
||||
Reference in New Issue
Block a user