summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt4
-rw-r--r--cmake/ctest.cmake2
-rw-r--r--mysql-test/suite/unit/suite.pm7
3 files changed, 5 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fa1ed701a81..8d2efac89cb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -362,10 +362,6 @@ INCLUDE(maintainer)
IF(WITH_UNIT_TESTS)
ENABLE_TESTING()
- # This is the only instance where ADD_TEST should be used,
- # to make sure that make test will run MTR,
- # use MY_ADD_TEST macro to add other tests
- ADD_TEST(NAME MTR COMMAND ./mysql-test-run WORKING_DIRECTORY "mysql-test")
ADD_SUBDIRECTORY(unittest/mytap)
ADD_SUBDIRECTORY(unittest/strings)
ADD_SUBDIRECTORY(unittest/examples)
diff --git a/cmake/ctest.cmake b/cmake/ctest.cmake
index fde7e1632f6..08852a366f6 100644
--- a/cmake/ctest.cmake
+++ b/cmake/ctest.cmake
@@ -2,7 +2,7 @@
INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/cmake_parse_arguments.cmake)
MACRO(MY_ADD_TEST name)
- ADD_TEST(NAME ${name} COMMAND ${name}-t CONFIGURATIONS default_ignore)
+ ADD_TEST(${name} ${name}-t)
ENDMACRO()
MACRO (MY_ADD_TESTS)
diff --git a/mysql-test/suite/unit/suite.pm b/mysql-test/suite/unit/suite.pm
index fa1da2ae4ff..48401b1579f 100644
--- a/mysql-test/suite/unit/suite.pm
+++ b/mysql-test/suite/unit/suite.pm
@@ -37,10 +37,11 @@ sub start_test {
}
{
+ my $bin=$ENV{MTR_BINDIR} || '..';
return "Not run for embedded server" if $::opt_embedded_server;
- return "Not configured to run ctest" unless -f "../CTestTestfile.cmake";
- my ($ctest_vs)= $opt_vs_config ? "--build-config $opt_vs_config" : "";
- my (@ctest_list)= `cd .. && ctest $opt_vs_config -E MTR -C default_ignore --show-only --verbose`;
+ return "Not configured to run ctest" unless -f "$bin/CTestTestfile.cmake";
+ my ($ctest_vs)= $::opt_vs_config ? "-C ".substr($::opt_vs_config,1) : "";
+ my (@ctest_list)= `cd $bin && ctest $ctest_vs --show-only --verbose`;
return "No ctest" if $?;
my ($command, %tests);