Commit c17bace4 authored by Sergei Golubchik's avatar Sergei Golubchik

Added --continue-on-error to mysqltest and mysql-test-run

This will contune the test case even if there was an error
and makes it easier to run a test that contains many sub tests against one engine.

(originally by Monty)
parent ddd3e261
This diff is collapsed.
......@@ -230,7 +230,7 @@ my %opts_extern;
sub using_extern { return (keys %opts_extern > 0);};
our $opt_fast= 0;
our $opt_force;
our $opt_force= 0;
our $opt_mem= $ENV{'MTR_MEM'};
our $opt_clean_vardir= $ENV{'MTR_CLEAN_VARDIR'};
......@@ -1136,7 +1136,7 @@ sub command_line_setup {
'defaults-extra-file=s' => \&collect_option,
# Control what test suites or cases to run
'force' => \$opt_force,
'force+' => \$opt_force,
'with-ndbcluster-only' => \&collect_option,
'include-ndbcluster' => \$opt_include_ndbcluster,
'skip-ndbcluster|skip-ndb' => \$opt_skip_ndbcluster,
......@@ -5856,6 +5856,11 @@ sub start_mysqltest ($) {
mtr_add_arg($args, "%s", $_) for @args_saved;
}
if ($opt_force > 1)
{
mtr_add_arg($args, "--continue-on-error");
}
my $suite = $tinfo->{suite};
if ($suite->{parent}) {
mtr_add_arg($args, "--overlay-dir=%s/", $suite->{dir});
......@@ -6285,7 +6290,11 @@ Options to control directories to use
Options to control what test suites or cases to run
force Continue to run the suite after failure
force Continue after a failure. When specified once, a
failure in a test file will abort this test file, and
the execution will continue from the next test file.
When specified twice, execution will continue executing
the failed test file from the next command.
with-ndbcluster-only Run only tests that include "ndb" in the filename
skip-ndb[cluster] Skip all tests that need cluster. Default.
include-ndb[cluster] Enable all tests that need cluster
......
select error;
mysqltest: At line 1: query 'select error' failed: 1054: Unknown column 'error' in 'field list'
SELECT ERROR;
mysqltest: At line 1: query 'SELECT ERROR' failed: 1054: Unknown column 'ERROR' in 'field list'
SELECT 2;
2
2
#
# mysqltest --continue-on-error
#
-- source include/not_embedded.inc
#
# with or without --continue-on-error the failing test should return an error
# but with --continue-on-error, the failing line does not abort the test
#
--error 1
--exec echo "select error; select 1;" | $MYSQL_TEST 2>&1
--exec echo "SELECT ERROR; SELECT 2;" | $MYSQL_TEST --continue-on-error 2>&1
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment