summaryrefslogtreecommitdiff
path: root/unittest
diff options
context:
space:
mode:
authorunknown <jimw@mysql.com>2006-04-13 13:01:57 -0700
committerunknown <jimw@mysql.com>2006-04-13 13:01:57 -0700
commitd23064a668e555c7b87c526b2e2bd76dd6f9d83a (patch)
treec1e9f2b1d43080af258cb346f4df22c09ced3b56 /unittest
parentc323e60c46c73efde0efea3ff056f83e17cb9009 (diff)
downloadmariadb-git-d23064a668e555c7b87c526b2e2bd76dd6f9d83a.tar.gz
Fix 'make distcheck' problems with new unittest code, and a small
portability problem. BitKeeper/etc/ignore: Use a wildcard to ignore all unittest *.t files unittest/Makefile.am: Add unit to DISTCLEANFILES, and make sure to copy it from srcdir unittest/examples/Makefile.am: Use srcdir to find mytap header unittest/mysys/Makefile.am: Use srcdir to find mytap header unittest/mytap/t/Makefile.am: Use builddir for finding mytap library unittest/mytap/tap.c: Fix portability problem (declarations after code in C code)
Diffstat (limited to 'unittest')
-rw-r--r--unittest/Makefile.am4
-rw-r--r--unittest/examples/Makefile.am2
-rw-r--r--unittest/mysys/Makefile.am2
-rw-r--r--unittest/mytap/t/Makefile.am2
-rw-r--r--unittest/mytap/tap.c5
5 files changed, 9 insertions, 6 deletions
diff --git a/unittest/Makefile.am b/unittest/Makefile.am
index 8943e58170d..f6dfb41e4e1 100644
--- a/unittest/Makefile.am
+++ b/unittest/Makefile.am
@@ -2,6 +2,8 @@ SUBDIRS = mytap . mysys examples
noinst_SCRIPTS = unit
+DISTCLEANFILES = unit
+
unittests = mysys examples
.PHONY: all mytap mysys examples test
@@ -18,6 +20,6 @@ mysys:
examples:
cd examples && $(MAKE)
-unit: unit.pl
+unit: $(srcdir)/unit.pl
cp $< $@
chmod +x $@
diff --git a/unittest/examples/Makefile.am b/unittest/examples/Makefile.am
index 2e48ab8d9b3..7990777d5b6 100644
--- a/unittest/examples/Makefile.am
+++ b/unittest/examples/Makefile.am
@@ -1,5 +1,5 @@
AM_CPPFLAGS = -I$(srcdir) -I$(top_builddir)/include
-AM_CPPFLAGS += -I$(top_builddir)/unittest/mytap
+AM_CPPFLAGS += -I$(top_srcdir)/unittest/mytap
AM_LDFLAGS = -L$(top_builddir)/unittest/mytap
diff --git a/unittest/mysys/Makefile.am b/unittest/mysys/Makefile.am
index 248dda84f7e..7cfc8175024 100644
--- a/unittest/mysys/Makefile.am
+++ b/unittest/mysys/Makefile.am
@@ -1,6 +1,6 @@
AM_CPPFLAGS = @ZLIB_INCLUDES@ -I$(top_builddir)/include
-AM_CPPFLAGS += -I$(top_srcdir)/include -I$(top_builddir)/unittest/mytap
+AM_CPPFLAGS += -I$(top_srcdir)/include -I$(top_srcdir)/unittest/mytap
AM_LDFLAGS = -L$(top_builddir)/unittest/mytap -L$(top_builddir)/mysys
AM_LDFLAGS += -L$(top_builddir)/strings -L$(top_builddir)/dbug
diff --git a/unittest/mytap/t/Makefile.am b/unittest/mytap/t/Makefile.am
index 88f663c2a9e..b8e140832a6 100644
--- a/unittest/mytap/t/Makefile.am
+++ b/unittest/mytap/t/Makefile.am
@@ -2,7 +2,7 @@
AM_CPPFLAGS = -I$(srcdir) -I$(top_builddir)/include
AM_CPPFLAGS += -I$(srcdir)/..
-AM_LDFLAGS = -L$(srcdir)/..
+AM_LDFLAGS = -L$(top_builddir)/unittest/mytap
AM_CFLAGS = -Wall -ansi -pedantic
diff --git a/unittest/mytap/tap.c b/unittest/mytap/tap.c
index 182210dda4f..2b728670cea 100644
--- a/unittest/mytap/tap.c
+++ b/unittest/mytap/tap.c
@@ -138,11 +138,12 @@ skip_all(char const *reason, ...)
void
ok(int const pass, char const *fmt, ...)
{
+ va_list ap;
+ va_start(ap, fmt);
+
if (!pass && *g_test.todo == '\0')
++g_test.failed;
- va_list ap;
- va_start(ap, fmt);
emit_tap(pass, fmt, ap);
va_end(ap);
if (*g_test.todo != '\0')