summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am2
-rw-r--r--tests/parser.tcl16
-rwxr-xr-xtests/parsertest2
-rw-r--r--tests/testruns/parser.conf2
-rw-r--r--tests/work/dummy3
5 files changed, 20 insertions, 5 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 5b579017..0de5a2f1 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -17,12 +17,14 @@ EXTRA_DIST=parser.tcl \
DevNull.cfgtest \
err1.rstest \
NoExistFile.cfgtest \
+ testruns/parser.conf \
testruns/1.parse1 \
testruns/rfc3164.parse1 \
testruns/rfc5424-1.parse1 \
testruns/rfc5424-2.parse1 \
testruns/rfc5424-3.parse1 \
testruns/rfc5424-4.parse1 \
+ work/dummy \
parsertest
rt_init_SOURCES = rt-init.c $(test_files)
diff --git a/tests/parser.tcl b/tests/parser.tcl
index 5872fa3c..047607c6 100644
--- a/tests/parser.tcl
+++ b/tests/parser.tcl
@@ -9,6 +9,8 @@
# Note: a lot of things are not elegant, but at least they work...
# Even simple things seem to be somewhat non-simple if you are
# not sufficiently involved with tcl/expect ;) -- rgerhards
+#
+# call: tclsh parser.tcl /director/with/testcases
#
# Copyright (C) 2009 by Rainer Gerhards and Adiscon GmbH
#
@@ -18,12 +20,22 @@ package require Expect
package require udp 1.0
log_user 0; # comment this out if you would like to see rsyslog output for testing
-set rsyslogdPID [spawn "../tools/rsyslogd" "-c4" "-ftestruns/parser.conf" "-u2" "-n" "-iwork/rsyslog.pid" "-M../runtime/.libs"];
+if {$argc > 1} {
+ puts "invalid number of parameters, usage: tclsh parser.tcl /directory/with/testcases";
+ exit 1;
+}
+if {$argc == 0 } {
+ set srcdir ".";
+} else {
+ set srcdir "$argv";
+}
+
+set rsyslogdPID [spawn "../tools/rsyslogd" "-c4" "-f$srcdir/testruns/parser.conf" "-u2" "-n" "-i$srcdir/work/rsyslog.pid" "-M../runtime/.libs"];
#interact;
expect "}}"; # eat startup message
set udpSock [udp_open];
udp_conf $udpSock 127.0.0.1 514
-set files [glob "testruns/*.parse1"]
+set files [glob "$srcdir/testruns/*.parse1"]
set failed 0;
puts "\nExecuting parser test suite...";
diff --git a/tests/parsertest b/tests/parsertest
index 78c42c07..c7efa631 100755
--- a/tests/parsertest
+++ b/tests/parsertest
@@ -1,2 +1,2 @@
# run parser test suite
-tclsh parser.tcl
+tclsh $srcdir/parser.tcl $srcdir
diff --git a/tests/testruns/parser.conf b/tests/testruns/parser.conf
index 3558f143..7b4b4aed 100644
--- a/tests/testruns/parser.conf
+++ b/tests/testruns/parser.conf
@@ -1,11 +1,9 @@
$ModLoad ../plugins/omstdout/.libs/omstdout
-$ModLoad ../plugins/imuxsock/.libs/imuxsock
$ModLoad ../plugins/imudp/.libs/imudp
$UDPServerRun 514
$ErrorMessagesToStderr off
# use a special format that we can easily parse in expect
-#$template expect,"{{%PRI%,%syslogtag%,%hostname%}}"
$template expect,"{{%PRI%,%syslogfacility-text%,%syslogseverity-text%,%timestamp%,%hostname%,%programname%,%syslogtag%,%msg%}}"
*.* :omstdout:;expect
diff --git a/tests/work/dummy b/tests/work/dummy
new file mode 100644
index 00000000..93c5babb
--- /dev/null
+++ b/tests/work/dummy
@@ -0,0 +1,3 @@
+This is a dummy file. It's only purpose is to ensure
+that ./test/work is created so that "make distcheck"
+and "make check" can operate properly.