mirror of
https://github.com/MariaDB/server.git
synced 2025-01-27 09:14:17 +01:00
Merge bk-internal.mysql.com:/home/bk/mysql-maria
into mysql.com:/home/my/mysql-maria
This commit is contained in:
commit
2c68346184
3 changed files with 21 additions and 17 deletions
|
@ -5,6 +5,8 @@
|
||||||
# from the end of file to invoke tests.c, which does the real dbug work.
|
# from the end of file to invoke tests.c, which does the real dbug work.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
use Test::More;
|
||||||
|
|
||||||
$exe=$0;
|
$exe=$0;
|
||||||
|
|
||||||
die unless $exe =~ s/(tests)-t(\.exe)?$/$1$2 /;
|
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
|
plan skip_all => "because dbug is disabled" if system $exe;
|
||||||
require Test::More;
|
|
||||||
import Test::More tests => scalar(@tests);
|
plan tests => scalar(@tests);
|
||||||
|
|
||||||
for (@tests) {
|
for (@tests) {
|
||||||
$t=$exe . shift @$_;
|
$t=$exe . shift @$_;
|
||||||
|
|
12
dbug/tests.c
12
dbug/tests.c
|
@ -2,10 +2,6 @@
|
||||||
A program to test DBUG features. Used by tests-t.pl
|
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;
|
char *push1=0;
|
||||||
|
|
||||||
#include <my_global.h> /* This includes dbug.h */
|
#include <my_global.h> /* This includes dbug.h */
|
||||||
|
@ -42,6 +38,12 @@ int func1()
|
||||||
int main (int argc, char *argv[])
|
int main (int argc, char *argv[])
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
#ifdef DBUG_OFF
|
||||||
|
return 1;
|
||||||
|
#endif
|
||||||
|
if (argc == 1)
|
||||||
|
return 0;
|
||||||
|
|
||||||
#if defined(HAVE_PTHREAD_INIT) && defined(THREAD)
|
#if defined(HAVE_PTHREAD_INIT) && defined(THREAD)
|
||||||
pthread_init(); /* Must be called before DBUG_ENTER */
|
pthread_init(); /* Must be called before DBUG_ENTER */
|
||||||
#endif
|
#endif
|
||||||
|
@ -75,7 +77,7 @@ int main (int argc, char *argv[])
|
||||||
DBUG_EVALUATE_IF("evaluate_if", "ON", "OFF"));
|
DBUG_EVALUATE_IF("evaluate_if", "ON", "OFF"));
|
||||||
DBUG_EXECUTE_IF("pop", DBUG_POP(); );
|
DBUG_EXECUTE_IF("pop", DBUG_POP(); );
|
||||||
{
|
{
|
||||||
char s[1000];
|
char s[1000] __attribute__((unused));
|
||||||
DBUG_EXPLAIN(s, sizeof(s)-1);
|
DBUG_EXPLAIN(s, sizeof(s)-1);
|
||||||
DBUG_PRINT("explain", ("dbug explained: %s", s));
|
DBUG_PRINT("explain", ("dbug explained: %s", s));
|
||||||
}
|
}
|
||||||
|
|
|
@ -112,19 +112,19 @@ extern void _db_flush_();
|
||||||
#define DBUG_EVALUATE(keyword,a1,a2) (a2)
|
#define DBUG_EVALUATE(keyword,a1,a2) (a2)
|
||||||
#define DBUG_EVALUATE_IF(keyword,a1,a2) (a2)
|
#define DBUG_EVALUATE_IF(keyword,a1,a2) (a2)
|
||||||
#define DBUG_PRINT(keyword,arglist) do { } while(0)
|
#define DBUG_PRINT(keyword,arglist) do { } while(0)
|
||||||
#define DBUG_PUSH(a1)
|
#define DBUG_PUSH(a1) do { } while(0)
|
||||||
#define DBUG_SET(a1)
|
#define DBUG_SET(a1) do { } while(0)
|
||||||
#define DBUG_SET_INITIAL(a1)
|
#define DBUG_SET_INITIAL(a1) do { } while(0)
|
||||||
#define DBUG_POP()
|
#define DBUG_POP() do { } while(0)
|
||||||
#define DBUG_PROCESS(a1)
|
#define DBUG_PROCESS(a1) do { } while(0)
|
||||||
#define DBUG_SETJMP(a1) setjmp(a1)
|
#define DBUG_SETJMP(a1) setjmp(a1)
|
||||||
#define DBUG_LONGJMP(a1) longjmp(a1)
|
#define DBUG_LONGJMP(a1) longjmp(a1)
|
||||||
#define DBUG_DUMP(keyword,a1,a2)
|
#define DBUG_DUMP(keyword,a1,a2) do { } while(0)
|
||||||
#define DBUG_END()
|
#define DBUG_END() do { } while(0)
|
||||||
#define DBUG_ASSERT(A) do { } while(0)
|
#define DBUG_ASSERT(A) do { } while(0)
|
||||||
#define DBUG_LOCK_FILE
|
#define DBUG_LOCK_FILE do { } while(0)
|
||||||
#define DBUG_FILE (stderr)
|
#define DBUG_FILE (stderr)
|
||||||
#define DBUG_UNLOCK_FILE
|
#define DBUG_UNLOCK_FILE do { } while(0)
|
||||||
#define DBUG_EXPLAIN(buf,len)
|
#define DBUG_EXPLAIN(buf,len)
|
||||||
#define DBUG_EXPLAIN_INITIAL(buf,len)
|
#define DBUG_EXPLAIN_INITIAL(buf,len)
|
||||||
#define DEBUGGER_OFF do { } while(0)
|
#define DEBUGGER_OFF do { } while(0)
|
||||||
|
|
Loading…
Add table
Reference in a new issue