Commit e17de669 authored by Geoff Simmons's avatar Geoff Simmons

Miscellaneous fixes to get 'make distcheck' working.

parent a86d18b0
......@@ -22,6 +22,9 @@ endif
include doxygen-include.am
EXTRA_DIST = README.rst autogen.sh m4/* $(DX_CONFIG) doc/html
EXTRA_DIST = README.rst autogen.sh $(DX_CONFIG) doc/html
doc/html: doxygen-run
clean-local:
-rm -rf doc/
......@@ -12,7 +12,7 @@ libtrackrdr_file_la_SOURCES = \
$(top_srcdir)/include/mq.h \
$(top_srcdir)/include/config_common.h \
$(top_srcdir)/include/miniobj.h \
$(top_srcdir)/src/config_common.c \
$(top_builddir)/src/config_common.c \
mq.c
libtrackrdr_file_la_LDFLAGS = -version-info ${CURRENT}:${REVISION}:${AGE}
......@@ -32,4 +32,6 @@ if HAVE_RST2MAN
${RST2MAN} README.rst $@
endif
EXTRA_DIST = README.rst
CLEANFILES = *~
......@@ -19,7 +19,7 @@ libtrackrdr_kafka_la_SOURCES = \
worker.c \
callback.c \
config.c \
$(top_srcdir)/src/config_common.c
$(top_builddir)/src/config_common.c
libtrackrdr_kafka_la_LIBADD = \
${PTHREAD_LIBS} \
......@@ -42,4 +42,6 @@ if HAVE_RST2MAN
${RST2MAN} README.rst $@
endif
EXTRA_DIST = README.rst
CLEANFILES = *~
......@@ -41,7 +41,7 @@
#include <pcre.h>
#ifdef HAVE_CONFIG_H
#include "../config.h"
#include "config.h"
#endif
#include "mq.h"
......
AM_CPPFLAGS = -I$(top_srcdir)/include
AM_CPPFLAGS = -I$(top_srcdir)/include -DTESTDIR=\"$(srcdir)/\"
TESTS = test_partition test_kafka
......@@ -66,3 +66,5 @@ test_send_ssl_LDADD = \
-lrdkafka -lz -lpthread -lrt -lzookeeper_mt -lpcre
CLEANFILES = kafka.log zoo.log *~
EXTRA_DIST = kafka.conf kafka_ssl.conf
......@@ -37,6 +37,10 @@
/* Automake exit code for "skipped" in make check */
#define EXIT_SKIPPED 77
#ifndef TESTDIR
# define TESTDIR "./"
#endif
#define KAFKA_CONFIG "kafka.conf"
#define NWORKERS 1
......@@ -51,7 +55,7 @@ static char
printf("... testing Kafka global initialization\n");
err = MQ_GlobalInit(NWORKERS, KAFKA_CONFIG);
err = MQ_GlobalInit(NWORKERS, TESTDIR KAFKA_CONFIG);
VMASSERT(err == NULL, "MQ_GlobalInit: %s", err);
return NULL;
......
AUTOMAKE_OPTIONS = subdir-objects
AM_CPPFLAGS = @VARNISH_CFLAGS@ -I$(top_srcdir)/include
AM_CPPFLAGS = @VARNISH_CFLAGS@ -I$(top_srcdir)/include -I$(builddir)/.. \
-DTESTDIR=\"$(srcdir)/\"
TESTS = test_parse test_data test_append test_mq test_spmcq \
test_config test_spmcq_loop.sh test_worker regress.sh
......@@ -8,6 +9,10 @@ TESTS = test_parse test_data test_append test_mq test_spmcq \
check_PROGRAMS = test_parse test_data test_append test_mq \
test_spmcq test_config test_worker
dist_check_SCRIPTS = test_spmcq_loop.sh regress.sh
AM_TESTS_ENVIRONMENT = TESTDIR=$(srcdir)
CLEANFILES = testing.log stderr.txt trackrdrd.pid trackrdrd_*.conf.new
DISTCLEANFILES = mq_test.log mq_log.log
......@@ -105,3 +110,7 @@ test_worker_LDADD = \
../config.$(OBJEXT) \
../config_common.$(OBJEXT) \
@VARNISH_LIBS@
EXTRA_DIST = file_mq.conf test.conf trackrdrd_001.conf trackrdrd_002.conf \
trackrdrd_003.conf trackrdrd_010.conf varnish.binlog \
varnish.legacy.binlog
......@@ -16,6 +16,7 @@ echo '... testing messages & log output at debug level against known checksums'
LOG=mq_log.log
MSG=mq_test.log
TESTDIR="${TESTDIR:-.}"
#
# $1 the binary log to read
......@@ -26,6 +27,12 @@ MSG=mq_test.log
function regress {
rm -f $LOG $MSG
if [ "$TESTDIR" != "." ]; then
cp $TESTDIR/$1 .
cp $TESTDIR/test.conf .
cp $TESTDIR/file_mq.conf .
fi
../trackrdrd -D -f $1 -l $LOG -d -c test.conf
# Check ckums of the log with and without logs from the worker thread,
......@@ -67,4 +74,8 @@ echo '... legacy VCL_Log syntax'
regress 'varnish.legacy.binlog' '3334052518 375477' '3908916621 57319' \
'1139478852 48689'
if [ "$TESTDIR" != "." ]; then
rm -f varnish.binlog varnish.legacy.binlog test.conf file_mq.conf
fi
exit 0
......@@ -44,6 +44,10 @@
/***** defines ****************************************************************/
#ifndef TESTDIR
# define TESTDIR "./"
#endif
#define DEFAULT_USER "nobody"
#define DEFAULT_PID_FILE "/var/run/trackrdrd.pid"
#define DEFAULT_RESTART_PAUSE 1
......@@ -121,19 +125,21 @@ static char
static char
*readAndCompare(const char * confName)
*readAndCompare(const char * testDir, const char * confFile)
{
int err;
char confNameNew[512];
char confName[512], confNameNew[512];
err = CONF_ReadDefault();
VMASSERT(err == 0, "Error code during reading default config: %i", err);
strcpy(confName, testDir);
strcat(confName, confFile);
err = CONF_ReadFile(confName, CONF_Add);
VMASSERT(err == 0,
"Error code during reading config \"%s\": %i", confName, err);
// verbose("Config is:\n%s", getConfigContent());
strcpy(confNameNew, confName);
strcpy(confNameNew, confFile);
strcat(confNameNew, ".new");
saveConfig(confNameNew);
VMASSERT(!TEST_compareFiles(confName, confNameNew),
......@@ -152,9 +158,9 @@ static const char
LOG_Open("trackrdrd");
LOG_SetLevel(7);
returnIfNotNull(readAndCompare("trackrdrd_001.conf"));
returnIfNotNull(readAndCompare("trackrdrd_002.conf"));
returnIfNotNull(readAndCompare("trackrdrd_003.conf"));
returnIfNotNull(readAndCompare(TESTDIR, "trackrdrd_001.conf"));
returnIfNotNull(readAndCompare(TESTDIR, "trackrdrd_002.conf"));
returnIfNotNull(readAndCompare(TESTDIR, "trackrdrd_003.conf"));
return NULL;
}
......@@ -185,8 +191,8 @@ static const char
printf("... testing CONF_ReadFile\n");
returnIfNotNull(
readAndFindError("trackrdrd_010.conf",
"Error in trackrdrd_010.conf line 12 "
readAndFindError(TESTDIR "trackrdrd_010.conf",
"Error in " TESTDIR "trackrdrd_010.conf line 12 "
"(Invalid argument): "
"'unknown.module = /my/path/module.so'\n"));
return NULL;
......
......@@ -37,6 +37,10 @@
#include "../trackrdrd.h"
#include "vas.h"
#ifndef TESTDIR
# define TESTDIR "./"
#endif
#define MQ_MODULE "../mq/file/.libs/libtrackrdr-file.so"
#define MQ_CONFIG "file_mq.conf"
......@@ -87,7 +91,7 @@ static char
printf("... testing MQ global initialization\n");
config.nworkers = NWORKERS;
strcpy(config.mq_config_file, MQ_CONFIG);
strcpy(config.mq_config_file, TESTDIR MQ_CONFIG);
err = mqf.global_init(config.nworkers, config.mq_config_file);
VMASSERT(err == NULL, "MQ_GlobalInit: %s", err);
......
......@@ -40,6 +40,10 @@
#include "../trackrdrd.h"
#include "../data.h"
#ifndef TESTDIR
# define TESTDIR "./"
#endif
#define DEBUG 0
#define debug_print(fmt, ...) \
do { if (DEBUG) fprintf(stderr, fmt, __VA_ARGS__); } while(0)
......@@ -113,7 +117,7 @@ static char
CONF_Init();
config.nworkers = NWORKERS;
strcpy(config.mq_config_file, MQ_CONFIG);
strcpy(config.mq_config_file, TESTDIR MQ_CONFIG);
error = mqf.global_init(config.nworkers, config.mq_config_file);
VMASSERT(error == NULL, "MQ_GlobalInit failed: %s", error);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment