diff options
author | unknown <guilhem@gbichot3.local> | 2006-09-15 11:05:35 +0200 |
---|---|---|
committer | unknown <guilhem@gbichot3.local> | 2006-09-15 11:05:35 +0200 |
commit | 09a7f30973304620e00b934597b72f7dd7eeb966 (patch) | |
tree | d98d69390fe0808955abd2a4388aa19c0e9b4580 | |
parent | cdf831cf94fe9aabde6ffb5b19557893416061d6 (diff) | |
download | mariadb-git-09a7f30973304620e00b934597b72f7dd7eeb966.tar.gz |
WL#3234 Maria Control file manager
last round of fixes to the storage engines' and plugins' unit tests
structure. Will extract a total patch and push it in 5.1 as has been
approved.
Makefile.am:
unittest must be before storage and plugin, because engine and plugin
may have unit tests which link with libtap which is found in
unitttest.
config/ac-macros/plugins.m4:
When enabling an engine/plugin, add its directory to the list
of directories where unit tests should be searched. That is,
its directory will be recursively searched by our unit test framework
which will execute any executable *-t file.
storage/maria/ma_control_file.c:
those my_message pollute the output of unit tests.
storage/maria/plug.in:
When Maria is enabled, add its unittest Makefile.
unittest/Makefile.am:
plugins too
-rw-r--r-- | Makefile.am | 4 | ||||
-rw-r--r-- | config/ac-macros/plugins.m4 | 24 | ||||
-rw-r--r-- | storage/maria/ma_control_file.c | 11 | ||||
-rw-r--r-- | storage/maria/plug.in | 2 | ||||
-rw-r--r-- | unittest/Makefile.am | 2 |
5 files changed, 19 insertions, 24 deletions
diff --git a/Makefile.am b/Makefile.am index 4adc06acad7..4f0faa59845 100644 --- a/Makefile.am +++ b/Makefile.am @@ -24,11 +24,11 @@ EXTRA_DIST = INSTALL-SOURCE INSTALL-WIN-SOURCE \ SUBDIRS = . include @docs_dirs@ @zlib_dir@ \ @readline_topdir@ sql-common \ @thread_dirs@ pstack \ - @sql_union_dirs@ storage plugin \ + @sql_union_dirs@ unittest storage plugin \ @sql_server@ scripts @man_dirs@ tests \ netware @libmysqld_dirs@ \ mysql-test support-files @tools_dirs@ \ - unittest win + win DIST_SUBDIRS = $(SUBDIRS) BUILD diff --git a/config/ac-macros/plugins.m4 b/config/ac-macros/plugins.m4 index ba7b3fcb087..87f057e696a 100644 --- a/config/ac-macros/plugins.m4 +++ b/config/ac-macros/plugins.m4 @@ -281,6 +281,7 @@ AC_DEFUN([MYSQL_CONFIGURE_PLUGINS],[ AC_SUBST([mysql_se_dirs]) AC_SUBST([mysql_pg_dirs]) AC_SUBST([mysql_se_unittest_dirs]) + AC_SUBST([mysql_pg_unittest_dirs]) ]) ]) ]) @@ -316,7 +317,6 @@ AC_DEFUN([__MYSQL_EMIT_CHECK_PLUGIN],[ ]) AC_MSG_CHECKING([whether to use ]$3) mysql_use_plugin_dir="" - mysql_use_plugin_unittest_dir="" m4_ifdef([$10],[ if test "X[$mysql_plugin_]$2" = Xyes -a \ "X[$with_plugin_]$2" != Xno -o \ @@ -409,26 +409,18 @@ dnl Although this is "pretty", it breaks libmysqld build m4_syscmd(test -f "$6/configure") ifelse(m4_sysval, 0, [AC_CONFIG_SUBDIRS($6)], - [ - AC_CONFIG_FILES($6/Makefile) - m4_syscmd(test -d "$6/unittest") - ifelse(m4_sysval, 0, - [ - mysql_use_plugin_unittest_dir="$6/unittest" - AC_CONFIG_FILES($6/unittest/Makefile) - ], []) - ] + [AC_CONFIG_FILES($6/Makefile)] ) ifelse(m4_substr($6, 0, 8), [storage/], [ - [mysql_se_name="]m4_substr($6, 8)" - mysql_se_dirs="$mysql_se_dirs $mysql_se_name" - if test -n "$mysql_use_plugin_unittest_dir" ; then - mysql_se_unittest_dirs="$mysql_se_unitest_dirs ../$mysql_use_plugin_unittest_dir" - fi + [mysql_se_dirs="$mysql_se_dirs ]m4_substr($6, 8)" + mysql_se_unittest_dirs="$mysql_se_unittest_dirs ../$6" ], m4_substr($6, 0, 7), [plugin/], - [mysql_pg_dirs="$mysql_pg_dirs ]m4_substr($6, 7)", + [ + [mysql_pg_dirs="$mysql_pg_dirs ]m4_substr($6, 7)" + mysql_pg_unittest_dirs="$mysql_pg_unittest_dirs ../$6" + ], [AC_FATAL([don't know how to handle plugin dir ]$6)]) fi ]) diff --git a/storage/maria/ma_control_file.c b/storage/maria/ma_control_file.c index 5b66577938f..5090fac4182 100644 --- a/storage/maria/ma_control_file.c +++ b/storage/maria/ma_control_file.c @@ -188,14 +188,17 @@ CONTROL_FILE_ERROR ma_control_file_create_or_open() disk/filesystem has a problem. So let's be rigid. */ - my_message(0, "too small file", MYF(0)); /* TODO: improve errors */ + /* + TODO: store a message "too small file" somewhere, so that it goes to + MySQL's error log at startup. + */ error= CONTROL_FILE_TOO_SMALL; goto err; } if ((uint)stat_buff.st_size > CONTROL_FILE_SIZE) { - my_message(0, "too big file", MYF(0)); /* TODO: improve errors */ + /* TODO: store "too big file" message */ error= CONTROL_FILE_TOO_BIG; goto err; } @@ -206,7 +209,7 @@ CONTROL_FILE_ERROR ma_control_file_create_or_open() if (memcmp(buffer + CONTROL_FILE_MAGIC_STRING_OFFSET, CONTROL_FILE_MAGIC_STRING, CONTROL_FILE_MAGIC_STRING_SIZE)) { - my_message(0, "bad magic string", MYF(0)); + /* TODO: store message "bad magic string" somewhere */ error= CONTROL_FILE_BAD_MAGIC_STRING; goto err; } @@ -214,7 +217,7 @@ CONTROL_FILE_ERROR ma_control_file_create_or_open() CONTROL_FILE_SIZE - CONTROL_FILE_LSN_OFFSET) != buffer[CONTROL_FILE_CHECKSUM_OFFSET]) { - my_message(0, "checksum mismatch", MYF(0)); + /* TODO: store message "checksum mismatch" somewhere */ error= CONTROL_FILE_BAD_CHECKSUM; goto err; } diff --git a/storage/maria/plug.in b/storage/maria/plug.in index de74293bd96..a9b35aefbfb 100644 --- a/storage/maria/plug.in +++ b/storage/maria/plug.in @@ -1,7 +1,7 @@ MYSQL_STORAGE_ENGINE(maria, no, [Maria Storage Engine], [Traditional transactional MySQL tables], [max,max-no-ndb]) MYSQL_PLUGIN_DIRECTORY(maria, [storage/maria]) +MYSQL_PLUGIN_ACTIONS(maria, [AC_CONFIG_FILES(storage/maria/unittest/Makefile)]) MYSQL_PLUGIN_STATIC(maria, [libmaria.a]) # Maria will probably go first into max builds, not all builds, # so we don't declare it mandatory. - diff --git a/unittest/Makefile.am b/unittest/Makefile.am index 76004e67fae..7323ef5fb77 100644 --- a/unittest/Makefile.am +++ b/unittest/Makefile.am @@ -4,7 +4,7 @@ noinst_SCRIPTS = unit EXTRA_DIST = unit.pl CLEANFILES = unit -unittests = mytap mysys @mysql_se_unittest_dirs@ +unittests = mytap mysys @mysql_se_unittest_dirs@ @mysql_pg_unittest_dirs@ test: unit ./unit run $(unittests) |