Skip to content

Commit 0ed6517

Browse files
Fix 'make distcheck' problems with new unittest code, and a small
portability problem.
1 parent 66c29e0 commit 0ed6517

6 files changed

Lines changed: 13 additions & 6 deletions

File tree

.bzrignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1760,3 +1760,7 @@ zlib/*.ds?
17601760
zlib/*.vcproj
17611761
mysql-test/r/*.log
17621762
client/mysql_upgrade
1763+
unittest/examples/*.t
1764+
unittest/mysys/*.t
1765+
unittest/mytap/t/*.t
1766+
unittest/unit

unittest/Makefile.am

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ SUBDIRS = mytap . mysys examples
22

33
noinst_SCRIPTS = unit
44

5+
DISTCLEANFILES = unit
6+
57
unittests = mysys examples
68

79
.PHONY: all mytap mysys examples test
@@ -18,6 +20,6 @@ mysys:
1820
examples:
1921
cd examples && $(MAKE)
2022

21-
unit: unit.pl
23+
unit: $(srcdir)/unit.pl
2224
cp $< $@
2325
chmod +x $@

unittest/examples/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
AM_CPPFLAGS = -I$(srcdir) -I$(top_builddir)/include
2-
AM_CPPFLAGS += -I$(top_builddir)/unittest/mytap
2+
AM_CPPFLAGS += -I$(top_srcdir)/unittest/mytap
33

44
AM_LDFLAGS = -L$(top_builddir)/unittest/mytap
55

unittest/mysys/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
AM_CPPFLAGS = @ZLIB_INCLUDES@ -I$(top_builddir)/include
3-
AM_CPPFLAGS += -I$(top_srcdir)/include -I$(top_builddir)/unittest/mytap
3+
AM_CPPFLAGS += -I$(top_srcdir)/include -I$(top_srcdir)/unittest/mytap
44

55
AM_LDFLAGS = -L$(top_builddir)/unittest/mytap -L$(top_builddir)/mysys
66
AM_LDFLAGS += -L$(top_builddir)/strings -L$(top_builddir)/dbug

unittest/mytap/t/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
AM_CPPFLAGS = -I$(srcdir) -I$(top_builddir)/include
33
AM_CPPFLAGS += -I$(srcdir)/..
44

5-
AM_LDFLAGS = -L$(srcdir)/..
5+
AM_LDFLAGS = -L$(top_builddir)/unittest/mytap
66

77
AM_CFLAGS = -Wall -ansi -pedantic
88

unittest/mytap/tap.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,12 @@ skip_all(char const *reason, ...)
138138
void
139139
ok(int const pass, char const *fmt, ...)
140140
{
141+
va_list ap;
142+
va_start(ap, fmt);
143+
141144
if (!pass && *g_test.todo == '\0')
142145
++g_test.failed;
143146

144-
va_list ap;
145-
va_start(ap, fmt);
146147
emit_tap(pass, fmt, ap);
147148
va_end(ap);
148149
if (*g_test.todo != '\0')

0 commit comments

Comments
 (0)