Permalink
Browse files

Get "make distcheck" to work.

  • Loading branch information...
1 parent 5b905b6 commit afd64951018b621bce66c588bace820cc10702a5 @kr committed Nov 25, 2008
Showing with 29 additions and 24 deletions.
  1. +1 −1 .gitignore
  2. +22 −19 Makefile.am
  3. +1 −1 configure.in
  4. +1 −1 {tests → }/cutgen.c
  5. +4 −2 shell_tests/run.sh
View
@@ -25,6 +25,6 @@ gmon.out
tags
cscope.out
tests/cutcheck*
-tests/cutgen
+cutgen
stamp-h1
.*.swp
View
@@ -16,7 +16,18 @@ aux_sources = \
util.c
beanstalkd_SOURCES = beanstalkd.c $(aux_sources)
-EXTRA_DIST = \
+tests = \
+ $(srcdir)/tests/test_conn.c \
+ $(srcdir)/tests/test_job.c \
+ $(srcdir)/tests/test_ms.c \
+ $(srcdir)/tests/test_net.c \
+ $(srcdir)/tests/test_pq.c \
+ $(srcdir)/tests/test_prot.c \
+ $(srcdir)/tests/test_reserve.c \
+ $(srcdir)/tests/test_tube.c \
+ $(srcdir)/tests/test_util.c
+
+EXTRA_DIST = cutgen.c $(tests) $(srcdir)/tests/cut.h shell_tests \
binlog.h \
conn.h \
job.h \
@@ -32,36 +43,28 @@ EXTRA_DIST = \
dist_doc_DATA = doc/protocol.txt
dist_man_MANS = doc/beanstalkd.1
-tests = \
- tests/test_conn.c \
- tests/test_job.c \
- tests/test_ms.c \
- tests/test_net.c \
- tests/test_pq.c \
- tests/test_prot.c \
- tests/test_reserve.c \
- tests/test_tube.c \
- tests/test_util.c
-
check-cut: tests/cutcheck
tests/cutcheck
check-shell: $(program)
- shell_tests/run.sh
+ $(srcdir)/shell_tests/run.sh $(srcdir)/shell_tests/*.commands
check: check-cut check-shell
-tests/cutcheck.c: $(tests) tests/cutgen
- tests/cutgen -o tests/cutcheck.c $(tests)
+cutgen: cutgen.c
+
+tests/cutcheck.c: $(tests) cutgen
+ mkdir -p tests
+ ./cutgen -o tests/cutcheck.c $(tests)
tests/cutcheck: tests/cutcheck.o $(aux_sources:.c=.o) $(tests:.c=.o)
$(LINK) $^ $(beanstalkd_LDADD) $(LIBS)
-clean:
- rm -f *.o tests/*.o tests/cutgen tests/cutcheck*
- rm -f $(program) .*.d core core.* gmon.out
- rm -f $(program)-*.tar.gz
+CLEANFILES = cutgen tests/cutcheck* tests/*.o
+
+DISTCLEANFILES = core core.* gmon.out $(program)-*.tar.gz
dist-hook:
echo -e '#!/bin/sh\n\n# This file was generated by "make dist".\necho $(VERSION)' > $(distdir)/version.sh
chmod +x $(distdir)/version.sh
+
View
@@ -5,7 +5,7 @@ AC_INIT
AC_CONFIG_SRCDIR([README])
AC_CONFIG_SRCDIR(job.c)
AC_CONFIG_HEADERS(config.h)
-AM_INIT_AUTOMAKE(beanstalkd,$(./version.sh))
+AM_INIT_AUTOMAKE(beanstalkd,$($srcdir/version.sh))
AM_MAINTAINER_MODE
AC_PROG_CC
@@ -452,7 +452,7 @@ char * libCUT[] =
"#include <stdlib.h>",
"#include <stdio.h>",
"#include <stdarg.h>",
- "#include \"cut.h\"",
+ "#include \"tests/cut.h\"",
"",
"#ifndef BOOL /* Just in case -- helps in portability */",
"#define BOOL int",
View
@@ -1,10 +1,12 @@
#!/bin/bash
+one="$(dirname "$0")/run_one.sh"
+
echo "Starting Tests..."
-for commands in shell_tests/*.commands; do
+for commands in "$@"; do
expected=${commands/.commands/.expected}
echo Testing $(echo $commands | sed -re 's/.*\/(.*)\..*/\1/')
- shell_tests/run_one.sh $commands $expected
+ $one $commands $expected
if test $? != 0; then
echo "!!! TEST FAILED !!!"
exit 1

0 comments on commit afd6495

Please sign in to comment.