From 5228dbc91ce5a9b6d180ac11c3621b55ef634cfd Mon Sep 17 00:00:00 2001 From: thor Date: Sat, 1 Mar 2014 09:05:27 +0000 Subject: [PATCH] Make the benchmark script check the return value. git-svn-id: svn://scm.orgis.org/mpg123/trunk@3518 35dc7657-300d-0410-a2e5-dc2837fedb53 --- scripts/benchmark-cpu.pl | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/benchmark-cpu.pl b/scripts/benchmark-cpu.pl index b9d3e04e..b28a98c4 100755 --- a/scripts/benchmark-cpu.pl +++ b/scripts/benchmark-cpu.pl @@ -44,11 +44,16 @@ foreach my $cpu (@cpus) { # using user CPU time my @start_time = times(); - system($MPG123_CMD, '-q', '--cpu', $cpu, '-e', $e, '-t', @TEST_FILES ); + my $ret = system($MPG123_CMD, '-q', '--cpu', $cpu, '-e', $e, '-t', @TEST_FILES ); my @end_time = times(); - + my $runtime = $end_time[2] - $start_time[2]; + if($ret) + { + print STDERR "Execution of $MPG123_CMD failed with code $ret!\n"; + $runtime = 0; + } # third entry is child user time - printf(" %4.2f", $end_time[2] - $start_time[2]); + printf(" %4.2f", $runtime); } print("\n"); }