From afd64951018b621bce66c588bace820cc10702a5 Mon Sep 17 00:00:00 2001 From: Keith Rarick Date: Tue, 25 Nov 2008 14:11:56 -0800 Subject: [PATCH] Get "make distcheck" to work. --- .gitignore | 2 +- Makefile.am | 41 ++++++++++++++++++++++------------------- configure.in | 2 +- tests/cutgen.c => cutgen.c | 2 +- shell_tests/run.sh | 6 ++++-- 5 files changed, 29 insertions(+), 24 deletions(-) rename tests/cutgen.c => cutgen.c (99%) diff --git a/.gitignore b/.gitignore index acdaa10..0a3aa8f 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,6 @@ gmon.out tags cscope.out tests/cutcheck* -tests/cutgen +cutgen stamp-h1 .*.swp diff --git a/Makefile.am b/Makefile.am index 8112421..99e4f3f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 + diff --git a/configure.in b/configure.in index 3af810b..8572f12 100644 --- a/configure.in +++ b/configure.in @@ -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 diff --git a/tests/cutgen.c b/cutgen.c similarity index 99% rename from tests/cutgen.c rename to cutgen.c index 04e4eb8..badd627 100644 --- a/tests/cutgen.c +++ b/cutgen.c @@ -452,7 +452,7 @@ char * libCUT[] = "#include ", "#include ", "#include ", - "#include \"cut.h\"", + "#include \"tests/cut.h\"", "", "#ifndef BOOL /* Just in case -- helps in portability */", "#define BOOL int", diff --git a/shell_tests/run.sh b/shell_tests/run.sh index 5d686f8..da5e659 100755 --- a/shell_tests/run.sh +++ b/shell_tests/run.sh @@ -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 -- 2.11.4.GIT