summaryrefslogtreecommitdiffstats
path: root/scripts/test.pl
diff options
context:
space:
mode:
authorRohan McGovern <rohan.mcgovern@nokia.com>2011-06-23 10:00:15 +0200
committerQt by Nokia <qt-info@nokia.com>2011-06-23 12:25:46 +0200
commit40d67f9a0a30b22be1010800c163ea809e3d5c92 (patch)
treeca873d8fb632b7832183f21edd6c1889dfcb63e2 /scripts/test.pl
parent6cd9ef9295301a8a9c3edb6a3d927dba0d15fd29 (diff)
test.pl: remove `--rerun-tests' as an option - always rerun tests
Using `--rerun-tests' is always necessary to get a test log with sufficient detail about failures, so I think it does not make sense for this to be an option. Change-Id: I755855ac2ae9010b188c1e49f50b238f8dd11859 Reviewed-on: http://codereview.qt.nokia.com/638 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
Diffstat (limited to 'scripts/test.pl')
-rwxr-xr-xscripts/test.pl67
1 files changed, 32 insertions, 35 deletions
diff --git a/scripts/test.pl b/scripts/test.pl
index 12c188c7..374d3b58 100755
--- a/scripts/test.pl
+++ b/scripts/test.pl
@@ -10,7 +10,7 @@ test.pl - run autotests for the Qt QA scripts
=head1 SYNOPSIS
- ./test.pl [ --clean ] [ --rerun-tests ]
+ ./test.pl [ --clean ]
Run the automated test suite in this repository.
@@ -28,13 +28,6 @@ This is the most accurate way to test that all prerequisites are
correctly specified in setup.pl. However, it significantly increases
the test time.
-=item --rerun-tests
-
-After running all of the autotests, run again any which have failed.
-This is a simple way to quickly show up any tests which are highly
-unstable, and to make it easier to read the output to see which
-tests have failed.
-
=back
On a typical clean Linux workstation, this script shouldn't require any
@@ -57,12 +50,10 @@ sub new
my %self = (
'clean' => 0,
- 'rerun-tests' => 0,
);
GetOptionsFromArray(\@args,
"clean" => \$self{ 'clean' },
- "rerun-tests" => \$self{ 'rerun-tests' },
"help" => sub { pod2usage(1) },
) || pod2usage(2);
@@ -130,17 +121,26 @@ sub run_prove
mkdir($tmpdir) || die "mkdir $tmpdir: $OS_ERROR";
local $ENV{TMPDIR} = $tmpdir;
+ # options always passed to `prove'
+ my @prove_options = (
+ # Let tests freely use modules under lib/perl5
+ '-I',
+ "$FindBin::Bin/lib/perl5",
+ );
+
my @prove = (
'prove',
+ @prove_options,
+
# Use `--merge' because we have some tests which are expected to output a
# lot of stderr which look like errors (e.g. test for the Pulse::x handling
# of transient errors). Having these visible by default is rather
# confusing to e.g. the CI system, which will extract these "errors" into
# report emails.
#
- # If we are re-running the tests later, we won't use `--merge', so failing
- # tests will still have all the details available.
+ # If there is a failure, we will re-run the tests later without `--merge',
+ # so failing tests will still have all the details available.
'--merge',
# Use `--state=save' so, if running manually, the user can easily
@@ -158,29 +158,26 @@ sub run_prove
$FindBin::Bin
);
- if (!$self->{'rerun-tests'}) {
- $self->system_or_die(@prove);
- }
- else {
- eval { $self->system_or_die(@prove) };
- my $error = $@;
- if ($error) {
- print "\n\nI'm going to run only the failed tests again:\n";
- $self->system_or_die(
- 'prove',
-
- # This will run only the tests which were marked as failing ...
- '--state=failed,save',
-
- # ...and this will be quite verbose, to aid in
- # figuring out the problem.
- '--verbose',
- );
-
- # The second attempt may have passed, in the case of unstable
- # tests, but we still should consider this a fatal error.
- die $error;
- }
+ eval { $self->system_or_die(@prove) };
+ my $error = $@;
+ if ($error) {
+ print "\n\nI'm going to run only the failed tests again:\n";
+ $self->system_or_die(
+ 'prove',
+
+ @prove_options,
+
+ # This will run only the tests which were marked as failing ...
+ '--state=failed,save',
+
+ # ...and this will be quite verbose, to aid in
+ # figuring out the problem.
+ '--verbose',
+ );
+
+ # The second attempt may have passed, in the case of unstable
+ # tests, but we still should consider this a fatal error.
+ die $error;
}
return;