summaryrefslogtreecommitdiff
path: root/dbug
diff options
context:
space:
mode:
authorunknown <serg@janus.mylan>2008-02-13 20:29:29 +0100
committerunknown <serg@janus.mylan>2008-02-13 20:29:29 +0100
commit0e4659bcd118842e494ffd3cac5897cc2d475295 (patch)
treec7a43302a20ecb3e056f377e9fa22daff293b93f /dbug
parent5cf9db531c46bf38e4e0d169ff359ea1d9fc36af (diff)
downloadmariadb-git-0e4659bcd118842e494ffd3cac5897cc2d475295.tar.gz
skip dbug tests if DBUG_OFF
include/my_dbug.h: warnings
Diffstat (limited to 'dbug')
-rwxr-xr-xdbug/tests-t.pl8
-rw-r--r--dbug/tests.c12
2 files changed, 12 insertions, 8 deletions
diff --git a/dbug/tests-t.pl b/dbug/tests-t.pl
index 4e4503f1ef7..fad77a74ce7 100755
--- a/dbug/tests-t.pl
+++ b/dbug/tests-t.pl
@@ -5,6 +5,8 @@
# from the end of file to invoke tests.c, which does the real dbug work.
#
+use Test::More;
+
$exe=$0;
die unless $exe =~ s/(tests)-t(\.exe)?$/$1$2 /;
@@ -21,9 +23,9 @@ while (<DATA>) {
}
}
-# require/import instead of use - we know the plan only when tests are loaded
-require Test::More;
-import Test::More tests => scalar(@tests);
+plan skip_all => "because dbug is disabled" if system $exe;
+
+plan tests => scalar(@tests);
for (@tests) {
$t=$exe . shift @$_;
diff --git a/dbug/tests.c b/dbug/tests.c
index edb999c0c60..d76266d34a3 100644
--- a/dbug/tests.c
+++ b/dbug/tests.c
@@ -2,10 +2,6 @@
A program to test DBUG features. Used by tests-t.pl
*/
-#ifdef DBUG_OFF /* We are testing dbug */
-#undef DBUG_OFF
-#endif
-
char *push1=0;
#include <my_global.h> /* This includes dbug.h */
@@ -42,6 +38,12 @@ int func1()
int main (int argc, char *argv[])
{
int i;
+#ifdef DBUG_OFF
+ return 1;
+#endif
+ if (argc == 1)
+ return 0;
+
#if defined(HAVE_PTHREAD_INIT) && defined(THREAD)
pthread_init(); /* Must be called before DBUG_ENTER */
#endif
@@ -75,7 +77,7 @@ int main (int argc, char *argv[])
DBUG_EVALUATE_IF("evaluate_if", "ON", "OFF"));
DBUG_EXECUTE_IF("pop", DBUG_POP(); );
{
- char s[1000];
+ char s[1000] __attribute__((unused));
DBUG_EXPLAIN(s, sizeof(s)-1);
DBUG_PRINT("explain", ("dbug explained: %s", s));
}