summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2011-07-16 09:09:01 +0200
committerSergei Golubchik <sergii@pisem.net>2011-07-16 09:09:01 +0200
commit2853f6bfbb2f392fa5623b480a2ce112991d2486 (patch)
tree4b089d92c563d49f563e6cadf4475a65974899a2
parent66a8da067793b717df0d4682357df15cba3c935f (diff)
downloadmariadb-git-2853f6bfbb2f392fa5623b480a2ce112991d2486.tar.gz
unit test fixes for ctest
-rw-r--r--CMakeLists.txt23
-rw-r--r--cmake/ctest.cmake24
-rw-r--r--dbug/CMakeLists.txt7
-rwxr-xr-xdbug/tests-t.pl5
-rw-r--r--storage/maria/CMakeLists.txt1
-rw-r--r--storage/maria/unittest/CMakeLists.txt97
-rw-r--r--storage/perfschema/CMakeLists.txt3
-rw-r--r--storage/perfschema/unittest/CMakeLists.txt18
-rw-r--r--unittest/examples/CMakeLists.txt23
-rw-r--r--unittest/mysys/CMakeLists.txt19
-rw-r--r--unittest/mytap/CMakeLists.txt2
-rw-r--r--unittest/strings/CMakeLists.txt3
12 files changed, 127 insertions, 98 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6766f76c665..c5e779654d9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -144,6 +144,7 @@ INCLUDE(readline)
INCLUDE(mysql_version)
INCLUDE(libutils)
INCLUDE(dtrace)
+INCLUDE(ctest)
INCLUDE(plugin)
INCLUDE(install_macros)
INCLUDE(install_layout)
@@ -269,6 +270,14 @@ IF(MYSQL_MAINTAINER_MODE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MY_MAINTAINER_CXX_WARNINGS}")
ENDIF()
+IF(WITH_UNIT_TESTS)
+ ENABLE_TESTING()
+ ADD_SUBDIRECTORY(unittest/mytap)
+ ADD_SUBDIRECTORY(unittest/strings)
+ ADD_SUBDIRECTORY(unittest/examples)
+ ADD_SUBDIRECTORY(unittest/mysys)
+ENDIF()
+
IF(NOT WITHOUT_SERVER)
SET (MYSQLD_STATIC_PLUGIN_LIBS "" CACHE INTERNAL "")
# Add storage engines and plugins.
@@ -276,22 +285,16 @@ SET (MYSQLD_STATIC_PLUGIN_LIBS "" CACHE INTERNAL "")
ENDIF()
ADD_SUBDIRECTORY(include)
-ADD_SUBDIRECTORY(dbug)
+IF(WITH_DEBUG)
+ ADD_SUBDIRECTORY(dbug)
+ SET(DBUG_LIBRARY dbug)
+ENDIF(WITH_DEBUG)
ADD_SUBDIRECTORY(strings)
ADD_SUBDIRECTORY(vio)
ADD_SUBDIRECTORY(regex)
ADD_SUBDIRECTORY(mysys)
ADD_SUBDIRECTORY(libmysql)
-
-IF(WITH_UNIT_TESTS)
- ENABLE_TESTING()
-ENDIF()
-IF(WITH_UNIT_TESTS)
- ADD_SUBDIRECTORY(unittest/mytap)
- ADD_SUBDIRECTORY(unittest/mysys)
-ENDIF()
-
ADD_SUBDIRECTORY(extra)
IF(NOT WITHOUT_SERVER)
ADD_SUBDIRECTORY(tests)
diff --git a/cmake/ctest.cmake b/cmake/ctest.cmake
new file mode 100644
index 00000000000..08852a366f6
--- /dev/null
+++ b/cmake/ctest.cmake
@@ -0,0 +1,24 @@
+
+INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/cmake_parse_arguments.cmake)
+
+MACRO(MY_ADD_TEST name)
+ ADD_TEST(${name} ${name}-t)
+ENDMACRO()
+
+MACRO (MY_ADD_TESTS)
+ MYSQL_PARSE_ARGUMENTS(ARG "LINK_LIBRARIES;EXT" "" ${ARGN})
+
+ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
+ ${CMAKE_SOURCE_DIR}/unittest/mytap)
+
+ IF (NOT ARG_EXT)
+ SET(ARG_EXT "c")
+ ENDIF()
+
+ FOREACH(name ${ARG_DEFAULT_ARGS})
+ ADD_EXECUTABLE(${name}-t "${name}-t.${ARG_EXT}")
+ TARGET_LINK_LIBRARIES(${name}-t mytap ${ARG_LINK_LIBRARIES})
+ MY_ADD_TEST(${name})
+ ENDFOREACH()
+ENDMACRO()
+
diff --git a/dbug/CMakeLists.txt b/dbug/CMakeLists.txt
index 09b3ed928ab..a408376a37d 100644
--- a/dbug/CMakeLists.txt
+++ b/dbug/CMakeLists.txt
@@ -45,9 +45,10 @@ IF(NOT WIN32)
COMMAND sed -e 's!\\\\!\\\\\\\\!g'
<${CMAKE_CURRENT_SOURCE_DIR}/${srcfile} >${file})
ENDFOREACH(file)
- ADD_CUSTOM_COMMAND(OUTPUT tests-t DEPENDS tests-t.pl
- COMMAND cp -f ${CMAKE_CURRENT_SOURCE_DIR}/tests-t.pl tests-t)
- ADD_CUSTOM_TARGET(unit ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/tests-t)
+ ADD_CUSTOM_COMMAND(OUTPUT dbug-t DEPENDS tests-t.pl
+ COMMAND cp -f ${CMAKE_CURRENT_SOURCE_DIR}/tests-t.pl dbug-t)
+ ADD_CUSTOM_TARGET(dbug-t ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/dbug-t)
+ MY_ADD_TEST(dbug)
IF(GROFF)
ADD_CUSTOM_COMMAND(OUTPUT user.ps
diff --git a/dbug/tests-t.pl b/dbug/tests-t.pl
index de9ed6f6ab9..9f517ba3efd 100755
--- a/dbug/tests-t.pl
+++ b/dbug/tests-t.pl
@@ -8,8 +8,9 @@
use Test::More;
$exe=$0;
+$exe =~ s@[^/]+$@tests@;
-die unless $exe =~ s/(tests)-t(\.exe)?$/$1$2 /;
+die unless -x $exe;
# load tests
@tests=();
@@ -28,7 +29,7 @@ plan skip_all => "because dbug is disabled" if system $exe;
plan tests => scalar(@tests);
for (@tests) {
- $t=$exe . shift @$_;
+ $t=$exe . ' ' . shift @$_;
chomp($t);
open F, '-|', $t or die "open($t|): $!";
local $";
diff --git a/storage/maria/CMakeLists.txt b/storage/maria/CMakeLists.txt
index d922b31f69c..545c8cb9318 100644
--- a/storage/maria/CMakeLists.txt
+++ b/storage/maria/CMakeLists.txt
@@ -87,3 +87,4 @@ ENDIF()
CMAKE_DEPENDENT_OPTION(USE_ARIA_FOR_TMP_TABLES "Use Aria for temporary tables" ON
"WITH_ARIA_STORAGE_ENGINE" OFF)
+ADD_SUBDIRECTORY(unittest)
diff --git a/storage/maria/unittest/CMakeLists.txt b/storage/maria/unittest/CMakeLists.txt
index fe6327c6ea3..1d63bed8e8e 100644
--- a/storage/maria/unittest/CMakeLists.txt
+++ b/storage/maria/unittest/CMakeLists.txt
@@ -15,81 +15,122 @@
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib
${CMAKE_SOURCE_DIR}/unittest/mytap)
-LINK_LIBRARIES(aria myisam mytap mysys dbug strings wsock32 zlib)
+LINK_LIBRARIES(aria myisam mytap mysys ${DBUG_LIBRARY} strings ${ZLIB_LIBRARY})
+
+MY_ADD_TESTS(ma_control_file trnman)
-ADD_EXECUTABLE(ma_control_file-t ma_control_file-t.c)
-ADD_EXECUTABLE(trnman-t trnman-t.c)
ADD_EXECUTABLE(ma_test_loghandler-t
- ma_test_loghandler-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c)
+ ma_test_loghandler-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c)
+MY_ADD_TEST(ma_test_loghandler)
+
ADD_EXECUTABLE(ma_test_loghandler_multigroup-t
- ma_test_loghandler_multigroup-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c sequence_storage.c)
+ ma_test_loghandler_multigroup-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c sequence_storage.c)
+MY_ADD_TEST(ma_test_loghandler_multigroup)
+
ADD_EXECUTABLE(ma_test_loghandler_multithread-t
- ma_test_loghandler_multithread-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c)
+ ma_test_loghandler_multithread-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c)
+MY_ADD_TEST(ma_test_loghandler_multithread)
+
ADD_EXECUTABLE(ma_test_loghandler_pagecache-t
- ma_test_loghandler_pagecache-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c)
+ ma_test_loghandler_pagecache-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c)
+MY_ADD_TEST(ma_test_loghandler_pagecache)
+
ADD_EXECUTABLE(ma_test_loghandler_long-t
- ma_test_loghandler-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c)
+ ma_test_loghandler-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c)
SET_TARGET_PROPERTIES(ma_test_loghandler_long-t PROPERTIES COMPILE_FLAGS "-DLONG_LOG_TEST")
+MY_ADD_TEST(ma_test_loghandler_long)
ADD_EXECUTABLE(ma_test_loghandler_noflush-t
- ma_test_loghandler_noflush-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c)
+ ma_test_loghandler_noflush-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c)
+MY_ADD_TEST(ma_test_loghandler_noflush)
+
ADD_EXECUTABLE(ma_test_loghandler_first_lsn-t
- ma_test_loghandler_first_lsn-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c)
+ ma_test_loghandler_first_lsn-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c)
+MY_ADD_TEST(ma_test_loghandler_first_lsn)
+
ADD_EXECUTABLE(ma_test_loghandler_max_lsn-t
- ma_test_loghandler_max_lsn-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c)
+ ma_test_loghandler_max_lsn-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c)
+MY_ADD_TEST(ma_test_loghandler_max_lsn)
+
ADD_EXECUTABLE(ma_test_loghandler_purge-t
- ma_test_loghandler_purge-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c)
+ ma_test_loghandler_purge-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c)
+MY_ADD_TEST(ma_test_loghandler_purge)
+
ADD_EXECUTABLE(ma_test_loghandler_readonly-t
- ma_test_loghandler_multigroup-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c sequence_storage.c)
+ ma_test_loghandler_multigroup-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c sequence_storage.c)
+MY_ADD_TEST(ma_test_loghandler_readonly)
+
SET_TARGET_PROPERTIES(ma_test_loghandler_readonly-t PROPERTIES COMPILE_FLAGS "-DREADONLY_TEST")
ADD_EXECUTABLE(ma_test_loghandler_nologs-t
- ma_test_loghandler_nologs-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c)
+ ma_test_loghandler_nologs-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c)
+MY_ADD_TEST(ma_test_loghandler_nologs)
-SET(ma_pagecache_single_src ma_pagecache_single.c test_file.c test_file.h)
+SET(ma_pagecache_single_src ma_pagecache_single.c test_file.c test_file.h)
SET(ma_pagecache_consist_src ma_pagecache_consist.c test_file.c test_file.h)
SET(ma_pagecache_common_cppflags "-DEXTRA_DEBUG -DPAGECACHE_DEBUG -DMAIN")
ADD_EXECUTABLE(ma_pagecache_single_1k-t ${ma_pagecache_single_src})
SET_TARGET_PROPERTIES(ma_pagecache_single_1k-t
- PROPERTIES COMPILE_FLAGS "${ma_pagecache_common_cppflags} -DTEST_PAGE_SIZE=1024")
+ PROPERTIES COMPILE_FLAGS "${ma_pagecache_common_cppflags} -DTEST_PAGE_SIZE=1024")
+MY_ADD_TEST(ma_pagecache_single_1k)
ADD_EXECUTABLE(ma_pagecache_single_8k-t ${ma_pagecache_single_src})
SET_TARGET_PROPERTIES(ma_pagecache_single_8k-t
- PROPERTIES COMPILE_FLAGS "${ma_pagecache_common_cppflags} -DTEST_PAGE_SIZE=8192")
+ PROPERTIES COMPILE_FLAGS "${ma_pagecache_common_cppflags} -DTEST_PAGE_SIZE=8192")
+MY_ADD_TEST(ma_pagecache_single_8k)
ADD_EXECUTABLE(ma_pagecache_single_64k-t ${ma_pagecache_single_src})
SET_TARGET_PROPERTIES(ma_pagecache_single_64k-t
- PROPERTIES COMPILE_FLAGS "${ma_pagecache_common_cppflags} -DTEST_PAGE_SIZE=65536")
+ PROPERTIES COMPILE_FLAGS "${ma_pagecache_common_cppflags} -DTEST_PAGE_SIZE=65536")
+MY_ADD_TEST(ma_pagecache_single_64k)
ADD_EXECUTABLE(ma_pagecache_consist_1k-t ${ma_pagecache_consist_src})
SET_TARGET_PROPERTIES(ma_pagecache_consist_1k-t
- PROPERTIES COMPILE_FLAGS "${ma_pagecache_common_cppflags} -DTEST_PAGE_SIZE=1024")
+ PROPERTIES COMPILE_FLAGS "${ma_pagecache_common_cppflags} -DTEST_PAGE_SIZE=1024")
+MY_ADD_TEST(ma_pagecache_consist_1k)
ADD_EXECUTABLE(ma_pagecache_consist_64k-t ${ma_pagecache_consist_src})
SET_TARGET_PROPERTIES(ma_pagecache_consist_64k-t
- PROPERTIES COMPILE_FLAGS "${ma_pagecache_common_cppflags} -DTEST_PAGE_SIZE=65536")
+ PROPERTIES COMPILE_FLAGS "${ma_pagecache_common_cppflags} -DTEST_PAGE_SIZE=65536")
+MY_ADD_TEST(ma_pagecache_consist_64k)
ADD_EXECUTABLE(ma_pagecache_consist_1kHC-t
- ${ma_pagecache_consist_src})
+ ${ma_pagecache_consist_src})
SET_TARGET_PROPERTIES(ma_pagecache_consist_1kHC-t
- PROPERTIES COMPILE_FLAGS "${ma_pagecache_common_cppflags} -DTEST_PAGE_SIZE=1024 -DTEST_HIGH_CONCURENCY")
+ PROPERTIES COMPILE_FLAGS "${ma_pagecache_common_cppflags} -DTEST_PAGE_SIZE=1024 -DTEST_HIGH_CONCURENCY")
+MY_ADD_TEST(ma_pagecache_consist_1kHC)
+
ADD_EXECUTABLE(ma_pagecache_consist_64kHC-t
- ${ma_pagecache_consist_src})
+ ${ma_pagecache_consist_src})
SET_TARGET_PROPERTIES(ma_pagecache_consist_64kHC-t
- PROPERTIES COMPILE_FLAGS "${ma_pagecache_common_cppflags} -DTEST_PAGE_SIZE=65536 -DTEST_HIGH_CONCURENCY")
+ PROPERTIES COMPILE_FLAGS "${ma_pagecache_common_cppflags} -DTEST_PAGE_SIZE=65536 -DTEST_HIGH_CONCURENCY")
+MY_ADD_TEST(ma_pagecache_consist_64kHC)
+
ADD_EXECUTABLE(ma_pagecache_consist_1kRD-t ${ma_pagecache_consist_src})
SET_TARGET_PROPERTIES(ma_pagecache_consist_1kRD-t
- PROPERTIES COMPILE_FLAGS "${ma_pagecache_common_cppflags} -DTEST_PAGE_SIZE=1024 -DTEST_READERS")
+ PROPERTIES COMPILE_FLAGS "${ma_pagecache_common_cppflags} -DTEST_PAGE_SIZE=1024 -DTEST_READERS")
+MY_ADD_TEST(ma_pagecache_consist_1kRD)
+
ADD_EXECUTABLE(ma_pagecache_consist_64kRD-t ${ma_pagecache_consist_src})
SET_TARGET_PROPERTIES(ma_pagecache_consist_64kRD-t
- PROPERTIES COMPILE_FLAGS "${ma_pagecache_common_cppflags} -DTEST_PAGE_SIZE=65536 -DTEST_READERS")
+ PROPERTIES COMPILE_FLAGS "${ma_pagecache_common_cppflags} -DTEST_PAGE_SIZE=65536 -DTEST_READERS")
+MY_ADD_TEST(ma_pagecache_consist_64kRD)
+
ADD_EXECUTABLE(ma_pagecache_consist_1kWR-t ${ma_pagecache_consist_src})
SET_TARGET_PROPERTIES(ma_pagecache_consist_1kWR-t
- PROPERTIES COMPILE_FLAGS "${ma_pagecache_common_cppflags} -DTEST_PAGE_SIZE=1024 -DTEST_WRITERS")
+ PROPERTIES COMPILE_FLAGS "${ma_pagecache_common_cppflags} -DTEST_PAGE_SIZE=1024 -DTEST_WRITERS")
+MY_ADD_TEST(ma_pagecache_consist_1kWR)
+
ADD_EXECUTABLE(ma_pagecache_consist_64kWR-t ${ma_pagecache_consist_src})
SET_TARGET_PROPERTIES(ma_pagecache_consist_64kWR-t
- PROPERTIES COMPILE_FLAGS "${ma_pagecache_common_cppflags} -DTEST_PAGE_SIZE=65536 -DTEST_WRITERS")
+ PROPERTIES COMPILE_FLAGS "${ma_pagecache_common_cppflags} -DTEST_PAGE_SIZE=65536 -DTEST_WRITERS")
+MY_ADD_TEST(ma_pagecache_consist_64kWR)
+
ADD_EXECUTABLE(ma_pagecache_rwconsist_1k-t ma_pagecache_rwconsist.c)
SET_TARGET_PROPERTIES(ma_pagecache_rwconsist_1k-t PROPERTIES COMPILE_FLAGS "-DTEST_PAGE_SIZE=1024")
+MY_ADD_TEST(ma_pagecache_rwconsist_1k)
+
ADD_EXECUTABLE(ma_pagecache_rwconsist2_1k-t ma_pagecache_rwconsist2.c)
SET_TARGET_PROPERTIES(ma_pagecache_rwconsist2_1k-t PROPERTIES COMPILE_FLAGS "-DTEST_PAGE_SIZE=1024")
+MY_ADD_TEST(ma_pagecache_rwconsist2_1k)
+
diff --git a/storage/perfschema/CMakeLists.txt b/storage/perfschema/CMakeLists.txt
index a3999da4ba1..7702b7365af 100644
--- a/storage/perfschema/CMakeLists.txt
+++ b/storage/perfschema/CMakeLists.txt
@@ -74,7 +74,6 @@ SET(PERFSCHEMA_SOURCES ha_perfschema.h
)
MYSQL_ADD_PLUGIN(perfschema ${PERFSCHEMA_SOURCES} STORAGE_ENGINE DEFAULT STATIC_ONLY)
-IF(WITH_PERFSCHEMA_STORAGE_ENGINE AND WITH_UNIT_TESTS)
- ENABLE_TESTING()
+IF(WITH_PERFSCHEMA_STORAGE_ENGINE)
ADD_SUBDIRECTORY(unittest)
ENDIF()
diff --git a/storage/perfschema/unittest/CMakeLists.txt b/storage/perfschema/unittest/CMakeLists.txt
index 501cf82d23a..7858fa4cc3e 100644
--- a/storage/perfschema/unittest/CMakeLists.txt
+++ b/storage/perfschema/unittest/CMakeLists.txt
@@ -23,19 +23,5 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
ADD_DEFINITIONS(-DMYSQL_SERVER)
-MACRO (PFS_ADD_TEST name)
- ADD_EXECUTABLE(${name}-t ${name}-t.cc)
- TARGET_LINK_LIBRARIES(${name}-t mytap perfschema mysys)
- ADD_TEST(${name} ${name}-t)
-ENDMACRO()
-
-SET(tests
- pfs_instr_class
- pfs_instr_class-oom
- pfs_instr
- pfs_instr-oom
- pfs
-)
-FOREACH(testname ${tests})
- PFS_ADD_TEST(${testname})
-ENDFOREACH()
+MY_ADD_TESTS(pfs_instr_class pfs_instr_class-oom pfs_instr pfs_instr-oom pfs
+ EXT "cc" LINK_LIBRARIES perfschema mysys)
diff --git a/unittest/examples/CMakeLists.txt b/unittest/examples/CMakeLists.txt
index 52272bc412e..86c4a5bea9e 100644
--- a/unittest/examples/CMakeLists.txt
+++ b/unittest/examples/CMakeLists.txt
@@ -13,25 +13,4 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib
- ${CMAKE_SOURCE_DIR}/sql
- ${CMAKE_SOURCE_DIR}/regex
- ${CMAKE_SOURCE_DIR}/extra/yassl/include
- ${CMAKE_SOURCE_DIR}/unittest/mytap)
-ADD_EXECUTABLE(simple-t simple-t.c)
-TARGET_LINK_LIBRARIES(simple-t mytap)
-
-ADD_EXECUTABLE(skip-t skip-t.c)
-TARGET_LINK_LIBRARIES(skip-t mytap)
-
-ADD_EXECUTABLE(todo-t todo-t.c)
-TARGET_LINK_LIBRARIES(todo-t mytap)
-
-ADD_EXECUTABLE(skip_all-t skip_all-t.c)
-TARGET_LINK_LIBRARIES(skip_all-t mytap)
-
-ADD_EXECUTABLE(no_plan-t no_plan-t.c)
-TARGET_LINK_LIBRARIES(no_plan-t mytap)
-
-ADD_EXECUTABLE(core-t core-t.c)
-TARGET_LINK_LIBRARIES(core-t mytap)
+MY_ADD_TESTS(simple skip todo skip_all no_plan)
diff --git a/unittest/mysys/CMakeLists.txt b/unittest/mysys/CMakeLists.txt
index 7bf046162c5..1de1bd19143 100644
--- a/unittest/mysys/CMakeLists.txt
+++ b/unittest/mysys/CMakeLists.txt
@@ -13,20 +13,9 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
- ${CMAKE_SOURCE_DIR}/sql
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/sql
${CMAKE_SOURCE_DIR}/regex
- ${CMAKE_SOURCE_DIR}/extra/yassl/include
- ${CMAKE_SOURCE_DIR}/unittest/mytap)
+ ${CMAKE_SOURCE_DIR}/extra/yassl/include)
-
-MACRO (MY_ADD_TEST name)
- ADD_EXECUTABLE(${name}-t ${name}-t.c)
- TARGET_LINK_LIBRARIES(${name}-t mytap mysys strings)
- ADD_TEST(${name} ${name}-t)
-ENDMACRO()
-
-
-FOREACH(testname bitmap base64 my_vsnprintf my_atomic my_rdtsc lf my_malloc)
- MY_ADD_TEST(${testname})
-ENDFOREACH()
+MY_ADD_TESTS(bitmap base64 my_vsnprintf my_atomic my_rdtsc lf my_malloc
+ LINK_LIBRARIES mysys)
diff --git a/unittest/mytap/CMakeLists.txt b/unittest/mytap/CMakeLists.txt
index 063c69eb925..40f23950369 100644
--- a/unittest/mytap/CMakeLists.txt
+++ b/unittest/mytap/CMakeLists.txt
@@ -15,3 +15,5 @@
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
ADD_LIBRARY(mytap tap.c)
+
+MY_ADD_TESTS(t/basic)
diff --git a/unittest/strings/CMakeLists.txt b/unittest/strings/CMakeLists.txt
new file mode 100644
index 00000000000..10791edfb61
--- /dev/null
+++ b/unittest/strings/CMakeLists.txt
@@ -0,0 +1,3 @@
+
+MY_ADD_TESTS(strings LINK_LIBRARIES strings)
+