#At file:///home/vvaintroub/bzr/mysql-next-mr-bugfixing/ based on revid:vvaintroub@stripped
3119 Vladislav Vaintroub 2010-03-10
Bug#51896 :make test-bt terminates too early with cmake.
Reason for it is test-bt is a custom target executing bunch of
COMMAND(perl mysql-test-run.pl ...). If one of the COMMAND fails, the
whole build termintates.
The fix is to write a cmake script run_collection that takes a
corresponding "collections" file and executes it line by line with
EXECUTE_PROCESS and ignore all EXECUTE_PROCESS errors.
- Also, added or fixed copyright notices.
added:
cmake/run_collection.cmake.in
modified:
.bzrignore
cmake/Makefile.am
cmake/cpack_source_ignore_files.cmake
mysql-test/CMakeLists.txt
=== modified file '.bzrignore'
--- a/.bzrignore 2010-03-01 10:07:06 +0000
+++ b/.bzrignore 2010-03-10 00:04:11 +0000
@@ -3080,3 +3080,4 @@ libmysqld/keycaches.cc
client/dtoa.c
libmysqld/sql_audit.cc
configure.am
+run_collection*.cmake
=== modified file 'cmake/Makefile.am'
--- a/cmake/Makefile.am 2010-02-24 19:07:05 +0000
+++ b/cmake/Makefile.am 2010-03-10 00:04:11 +0000
@@ -1,3 +1,18 @@
+# Copyright (c) 2009, 2010, 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
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
EXTRA_DIST = \
cmake_parse_arguments.cmake \
cpack_source_ignore_files.cmake \
@@ -16,6 +31,7 @@ EXTRA_DIST = \
mysql_version.cmake \
install_macros.cmake \
ssl.cmake \
+ run_collection.cmake.in \
plugin.cmake \
zlib.cmake \
stack_direction.c \
=== modified file 'cmake/cpack_source_ignore_files.cmake'
--- a/cmake/cpack_source_ignore_files.cmake 2010-02-24 19:07:05 +0000
+++ b/cmake/cpack_source_ignore_files.cmake 2010-03-10 00:04:11 +0000
@@ -1,3 +1,18 @@
+# Copyright (c) 2009, 2010, 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
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
SET(CPACK_SOURCE_IGNORE_FILES
\\\\.bzr/
\\\\.bzr-mysql
@@ -36,5 +51,8 @@ include/config\\\\.h$
include/my_config\\\\.h$
/autom4te\\\\.cache/
errmsg\\\\.sys$
+run_collection_test-bt.cmake
+run_collection_test-bt-debug.cmake
+run_collection_test-bt-fast.cmake
#
)
=== added file 'cmake/run_collection.cmake.in'
--- a/cmake/run_collection.cmake.in 1970-01-01 00:00:00 +0000
+++ b/cmake/run_collection.cmake.in 2010-03-10 00:04:11 +0000
@@ -0,0 +1,54 @@
+# Copyright (c) 2010, 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
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+SET(SCRIPT "@SCRIPT@")
+SET(WITH_EMBEDDED_SERVER "@WITH_EMBEDDED_SERVER@")
+SET(CMAKE_SOURCE_DIR "@CMAKE_SOURCE_DIR@")
+
+FILE(STRINGS "${SCRIPT}" commands)
+FOREACH(command ${commands})
+ SET(SKIP_COMMAND 0)
+
+ IF(NOT WITH_EMBEDDED_SERVER)
+ IF(command MATCHES "--embedded")
+ MESSAGE(STATUS
+ "Skipping command ${command}, because embedded server was not built")
+ SET(SKIP_COMMAND 1)
+ ENDIF()
+ ENDIF()
+
+ IF(command MATCHES "--suite=nist")
+ IF(NOT EXISTS ${CMAKE_SOURCE_DIR}/mysql-test/suite/nist)
+ MESSAGE(STATUS
+ "Skipping command ${command}, because NIST test suite does not exist")
+ SET(SKIP_COMMAND 1)
+ ENDIF()
+ ENDIF()
+
+ IF(NOT SKIP_COMMAND)
+ # Convert string to list (EXECUTE_PROCESS needs lists)
+ STRING(REGEX REPLACE "[ ]+" ";" command "${command}" )
+ EXECUTE_PROCESS(COMMAND ${command} RESULT_VARIABLE result)
+ IF(NOT result EQUAL 0)
+ # Give a non-fatal warning if process failed
+ LIST(LENGTH command length)
+ IF(length)
+ LIST(GET command 0 exe)
+ MESSAGE(STATUS "EXECUTE_PROCESS ${exe} failed with ${result}")
+ ENDIF()
+ ENDIF()
+ ENDIF()
+ENDFOREACH()
+
=== modified file 'mysql-test/CMakeLists.txt'
--- a/mysql-test/CMakeLists.txt 2010-03-03 11:29:34 +0000
+++ b/mysql-test/CMakeLists.txt 2010-03-10 00:04:11 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 Sun Microsystems, Inc
+# Copyright (c) 2009, 2010, 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
@@ -14,16 +14,16 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
INSTALL(
- DIRECTORY .
- DESTINATION ${INSTALL_MYSQLTESTDIR}
- PATTERN "var/" EXCLUDE
- PATTERN "lib/My/SafeProcess" EXCLUDE
- PATTERN "CPack" EXCLUDE
- PATTERN "CMake*" EXCLUDE
- PATTERN "mtr.out*" EXCLUDE
- PATTERN ".cvsignore" EXCLUDE
- PATTERN "*.am" EXCLUDE
- PATTERN "*.in" EXCLUDE
+ DIRECTORY .
+ DESTINATION ${INSTALL_MYSQLTESTDIR}
+ PATTERN "var/" EXCLUDE
+ PATTERN "lib/My/SafeProcess" EXCLUDE
+ PATTERN "CPack" EXCLUDE
+ PATTERN "CMake*" EXCLUDE
+ PATTERN "mtr.out*" EXCLUDE
+ PATTERN ".cvsignore" EXCLUDE
+ PATTERN "*.am" EXCLUDE
+ PATTERN "*.in" EXCLUDE
)
@@ -38,15 +38,15 @@ IF(NOT ${CMAKE_SOURCE_DIR} STREQUAL ${CM
ENDIF()
IF(UNIX)
EXECUTE_PROCESS(
- COMMAND chmod +x mysql-test-run.pl
- COMMAND ${CMAKE_COMMAND} -E create_symlink
- ./mysql-test-run.pl mtr
- COMMAND ${CMAKE_COMMAND} -E create_symlink
- ./mysql-test-run.pl mysql-test-run
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ COMMAND chmod +x mysql-test-run.pl
+ COMMAND ${CMAKE_COMMAND} -E create_symlink
+ ./mysql-test-run.pl mtr
+ COMMAND ${CMAKE_COMMAND} -E create_symlink
+ ./mysql-test-run.pl mysql-test-run
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/mtr
- ${CMAKE_CURRENT_BINARY_DIR}/mysql-test-run DESTINATION mysql-test)
+ ${CMAKE_CURRENT_BINARY_DIR}/mysql-test-run DESTINATION mysql-test)
ENDIF()
IF(CMAKE_GENERATOR MATCHES "Visual Studio")
@@ -67,25 +67,9 @@ ENDIF()
SET(EXP --experimental=collections/default.experimental)
IF(WIN32)
- SET(SET_ENV set)
+ SET(SET_ENV set)
ELSE()
- SET(SET_ENV export)
-ENDIF()
-
-
-SET(MTR_FORCE perl ./mysql-test-run.pl --force)
-IF(EXISTS ${CMAKE_SOURCE_DIR}/mysql-test/suite/nist)
- SET(TEST_NIST ${MTR_FORCE} --comment=nist suite=nist ${EXP} &&
- ${MTR_FORCE} --comment=nist --force --suite=nist+ps ${EXP})
-ELSE()
- SET(TEST_NIST echo "NIST tests not found")
-ENDIF()
-
-IF(WITH_EMBEDDED_SERVER)
- SET(TEST_EMBEDDED ${MTR_FORCE} --comment=embedded --timer --embedded-server
- --skip-rpl --skip-ndbcluster $(EXP))
-ELSE()
- SET(TEST_EMBEDDED echo "Can not test embedded, not compiled in")
+ SET(SET_ENV export)
ENDIF()
SET(TEST_BT_START
@@ -96,30 +80,20 @@ SET(TEST_BT_START
ADD_CUSTOM_TARGET(test-force
${TEST_BT_START}
- COMMAND ${MTR_FORCE}
-)
-
-ADD_CUSTOM_TARGET(test-bt
- ${TEST_BT_START}
- COMMAND ${MTR_FORCE} --comment=normal --timer --skip-ndbcluster --report-features ${EXP}
- COMMAND ${MTR_FORCE} --comment=ps --timer --skip-ndbcluster --ps-protocol ${EXP}
- COMMAND ${MTR_FORCE} --comment=funcs1+ps --ps-protocol --reorder --suite=funcs_1 ${EXP}
- COMMAND ${MTR_FORCE} --comment=funcs2 --suite=funcs_2 ${EXP}
- COMMAND ${MTR_FORCE} --comment=partitions --suite=parts ${EXP}
- COMMAND ${MTR_FORCE} --comment=stress --suite=stress ${EXP}
- COMMAND ${MTR_FORCE} --force --comment=jp --suite=jp ${EXP}
- COMMAND ${TEST_NIST}
- COMMAND ${TEST_EMBEDDED}
-)
-
-ADD_CUSTOM_TARGET(test-bt-fast
- ${TEST_BT_START}
- COMMAND ${MTR_FORCE} --comment=ps --timer --skip-ndbcluster --ps-protocol --report-features ${EXP}
- COMMAND ${MTR_FORCE} --comment=stress --suite=stress ${EXP}
-)
-
-ADD_CUSTOM_TARGET(test-bt-debug
- ${TEST_BT_START}
- COMMAND ${MTR_FORCE} --comment=debug --timer --skip-ndbcluster --skip-rpl --report-features ${EXP}
+ COMMAND perl ./mysql-test-run.pl --force ${EXP}
)
+FOREACH(collection test-bt test-bt-fast test-bt-debug)
+ IF(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/collections/${collection})
+ MESSAGE(FATAL_ERROR
+ "${CMAKE_CURRENT_SOURCE_DIR}/collections/${collection} does not exist")
+ ENDIF()
+ SET(SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/collections/${collection})
+ CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/cmake/run_collection.cmake.in
+ ${CMAKE_CURRENT_BINARY_DIR}/run_collection_${collection}.cmake @ONLY)
+ ADD_CUSTOM_TARGET(
+ ${collection}
+ COMMAND ${TEST_BT_START}
+ COMMAND ${CMAKE_COMMAND} -P run_collection_${collection}.cmake
+ )
+ENDFOREACH()
Attachment: [text/bzr-bundle] bzr/vvaintroub@mysql.com-20100310000411-o3sgf1n3533iroqn.bundle