summaryrefslogtreecommitdiff
path: root/t/perf
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2018-11-20 10:59:22 +0000
committerDavid Mitchell <davem@iabyn.com>2018-11-20 10:59:22 +0000
commit516795a0389685dee830e0ca027811f000a5ed08 (patch)
treeb06fa5328527d02840a3bddcdd429a12b0880658 /t/perf
parent6c5080f25fa3dcede391007ffe328ea53779c52f (diff)
downloadperl-516795a0389685dee830e0ca027811f000a5ed08.tar.gz
t/perf/benchmarks.t: improve do error checks
Make the checks for "do 't/perf/benchmarks'" look more like those suggested for 'do' in perlfunc. In particular, this may help track down the issue in RT #133663.
Diffstat (limited to 't/perf')
-rw-r--r--t/perf/benchmarks.t9
1 files changed, 7 insertions, 2 deletions
diff --git a/t/perf/benchmarks.t b/t/perf/benchmarks.t
index 57dbcf8793..9babda3b01 100644
--- a/t/perf/benchmarks.t
+++ b/t/perf/benchmarks.t
@@ -15,8 +15,13 @@ use strict;
my $file = 'perf/benchmarks';
my $benchmark_array = do $file;
-die $@ if $@;
-die "$! while trying to read '$file'" if $!;
+unless ($benchmark_array) {
+ die "Error while parsing '$file': $@\n" if $@;
+ die "Error while trying to read '$file': $!"
+ unless defined $benchmark_array;
+ die "Unknown error running '$file'\n";
+}
+
die "'$file' did not return an array ref\n"
unless ref $benchmark_array eq 'ARRAY';