From 3f15d3bad986c36317be75607c6a928ef4978028 Mon Sep 17 00:00:00 2001 From: Monty Date: Mon, 1 Mar 2021 17:51:44 +0200 Subject: [PATCH] Fixed unit test to not 'bail out' if some tests are not compiled. Before the changes two things could happen: - "path required name explain_filename path" error - unit test never finishead (as it tried to execute just /bin/sh as a test case) --- mysql-test/suite/unit/suite.pm | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/mysql-test/suite/unit/suite.pm b/mysql-test/suite/unit/suite.pm index c8180c59240..43c9e115de6 100644 --- a/mysql-test/suite/unit/suite.pm +++ b/mysql-test/suite/unit/suite.pm @@ -20,7 +20,6 @@ sub start_test { ($path, $args) = ($cmd, , [ ]) } - my $oldpwd=getcwd(); chdir $::opt_vardir; my $proc=My::SafeProcess->new @@ -44,15 +43,17 @@ sub start_test { my (@ctest_list)= `cd "$bin" && ctest $ctest_vs --show-only --verbose`; return "No ctest" if $?; + $ENV{MYSQL_TEST_PLUGINDIR}=$::plugindir; + my ($command, %tests, $prefix); for (@ctest_list) { chomp; - if (/^\d+: Test command: +/) { - $command= $'; + if (/^\d+: Test command: +([^ \t]+)/) { + $command= $1; $prefix= /libmariadb/ ? 'conc_' : ''; - } elsif (/^ +Test +#\d+: +/) { - if ($command ne "NOT_AVAILABLE") { - $tests{$prefix.$'}=$command; + } elsif (/^ +Test +#\d+: ([^ \t]+)/) { + if ($command ne "NOT_AVAILABLE" && $command ne "/bin/sh") { + $tests{$prefix.$1}=$command; } } }