diff options
author | Mauritz Sundell <mauritz.sundell@oracle.com> | 2015-04-17 13:57:55 +0200 |
---|---|---|
committer | Mauritz Sundell <mauritz.sundell@oracle.com> | 2015-04-17 14:51:46 +0200 |
commit | 30c14893c7f0e8a9086eccf74ca9534ac8f7c5db (patch) | |
tree | 582ad4a158bb68175110417a5a2af018457c4712 | |
parent | 51d04c4cd9b1c408dd503213963cfbf3520e3096 (diff) | |
download | mariadb-git-30c14893c7f0e8a9086eccf74ca9534ac8f7c5db.tar.gz |
Bug#20814396 PB2 IS SECRET ABOUT WHAT UNIT TESTS IT RUN
One can not see in PB2 test logs which unit tests have been run
and passed.
This patchs adds an option --unit-tests-report to mtr which
include the ctest report in mtr output. It will also turn on unit
testing if not explicitly turned off with --no-unit-tests or
equivalent.
In manual runs one can always look in the ctest.log file in mtr
vardir.
--unit-tests are replaced with --unit-tests-report in files under
mysql-test/collections/ to activate report in PB2.
-rwxr-xr-x | mysql-test/mysql-test-run.pl | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index f82e67ef5b6..02ff577c7bf 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1,7 +1,7 @@ #!/usr/bin/perl # -*- cperl -*- -# Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -201,6 +201,7 @@ our @opt_cases; # The test cases names in argv our $opt_embedded_server; # -1 indicates use default, override with env.var. our $opt_ctest= env_or_val(MTR_UNIT_TESTS => -1); +our $opt_ctest_report; # Unit test report stored here for delayed printing my $ctest_report; @@ -1168,6 +1169,7 @@ sub command_line_setup { 'report-times' => \$opt_report_times, 'result-file' => \$opt_resfile, 'unit-tests!' => \$opt_ctest, + 'unit-tests-report!' => \$opt_ctest_report, 'stress=s' => \$opt_stress, 'help|h' => \$opt_usage, @@ -1606,12 +1608,21 @@ sub command_line_setup { } # -------------------------------------------------------------------------- - # Don't run ctest if tests or suites named + # Set default values for opt_ctest (--unit-tests) # -------------------------------------------------------------------------- - $opt_ctest= 0 if $opt_ctest == -1 && ($opt_suites || @opt_cases); - # Override: disable if running in the PB test environment - $opt_ctest= 0 if $opt_ctest == -1 && defined $ENV{PB2WORKDIR}; + if ($opt_ctest == -1) { + if (defined $opt_ctest_report && $opt_ctest_report) { + # Turn on --unit-tests by default if --unit-tests-report is used + $opt_ctest= 1; + } elsif ($opt_suites || @opt_cases) { + # Don't run ctest if tests or suites named + $opt_ctest= 0; + } elsif (defined $ENV{PB2WORKDIR}) { + # Override: disable if running in the PB test environment + $opt_ctest= 0; + } + } # -------------------------------------------------------------------------- # Check use of wait-all @@ -6079,6 +6090,8 @@ sub run_ctest() { open (CTEST, " > $ctfile") or die ("Could not open output file $ctfile"); + $ctest_report .= $ctest_out if $opt_ctest_report; + # Put ctest output in log file, while analyzing results for (split ('\n', $ctest_out)) { print CTEST "$_\n"; @@ -6335,6 +6348,7 @@ Misc options nounit-tests Do not run unit tests. Normally run if configured and if not running named tests/suites unit-tests Run unit tests even if they would otherwise not be run + unit-tests-report Include report of every test included in unit tests. stress=ARGS Run stress test, providing options to mysql-stress-test.pl. Options are separated by comma. |