diff --git a/.gitignore b/.gitignore index a284760..1171dd5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,6 @@ -SOURCES/bogofilter-1.2.5.tar.xz +bogofilter-1.2.0.tar.gz +bogofilter-1.2.2.tar.gz +/bogofilter-1.2.3.tar.gz +/bogofilter-1.2.3.repack.tar.gz +/bogofilter-1.2.4.repack.tar.gz /bogofilter-1.2.5.tar.xz diff --git a/tests/builtin-tests.patch b/tests/builtin-tests.patch new file mode 100644 index 0000000..3e31bb2 --- /dev/null +++ b/tests/builtin-tests.patch @@ -0,0 +1,49 @@ +diff -up bogofilter-1.2.4/src/tests/t.bogoutil.orig bogofilter-1.2.4/src/tests/t.bogoutil +--- bogofilter-1.2.4/src/tests/t.bogoutil.orig 2013-06-29 16:52:45.000000000 +0200 ++++ bogofilter-1.2.4/src/tests/t.bogoutil 2020-02-10 11:24:34.754000000 +0100 +@@ -78,7 +78,7 @@ if [ $DB_TYPE = db ] ; then + fi + + #test with wordlist in current directory +-BOGOUTIL="$VAL`pwd`/${relpath}/bogoutil$EXE_EXT" ++#BOGOUTIL="$VAL`pwd`/${relpath}/bogoutil$EXE_EXT" + WORDLIST="wordlist.${DB_EXT}" + OPC=$PRINTCORE + case $srcdir in +diff -up bogofilter-1.2.4/src/tests/t.config.orig bogofilter-1.2.4/src/tests/t.config +--- bogofilter-1.2.4/src/tests/t.config.orig 2020-02-10 11:20:55.340000000 +0100 ++++ bogofilter-1.2.4/src/tests/t.config 2020-02-10 11:21:00.668000000 +0100 +@@ -3,3 +3,4 @@ DB_EXT=".db" + DB_TYPE="db" + USE_TRANSACTIONS="" + USE_UNICODE="" ++USE_PREFIX=/usr/bin +diff -up bogofilter-1.2.4/src/tests/t.frame.orig bogofilter-1.2.4/src/tests/t.frame +--- bogofilter-1.2.4/src/tests/t.frame.orig 2020-02-10 11:20:47.446000000 +0100 ++++ bogofilter-1.2.4/src/tests/t.frame 2020-02-10 11:21:00.671000000 +0100 +@@ -15,7 +15,7 @@ set -e + fi + + : ${srcdir=.} +-: ${relpath=..} ++: ${relpath=} + : ${BF_TESTDIR=.} + + # suck in EXE_EXT and DB_TYPE, export the latter. +@@ -24,11 +24,11 @@ export DB_TYPE + DB_EXT=${DB_EXT#.} + export DB_EXT + +-BOGOFILTER="$VAL${relpath}/bogofilter$EXE_EXT" +-BOGOLEXER="$VAL${relpath}/bogolexer$EXE_EXT" +-BOGOTUNE="$VAL${relpath}/bogotune$EXE_EXT" +-BOGOUTIL="$VAL${relpath}/bogoutil$EXE_EXT" +-BF_COMPACT="${relpath}/bf_compact" ++BOGOFILTER="${USE_PREFIX}/bogofilter$EXE_EXT" ++BOGOLEXER="${USE_PREFIX}/bogolexer$EXE_EXT" ++BOGOTUNE="${USE_PREFIX}/bogotune$EXE_EXT" ++BOGOUTIL="${USE_PREFIX}/bogoutil$EXE_EXT" ++BF_COMPACT="${USE_PREFIX}/bf_compact" + + export BOGOFILTER + export BOGOLEXER diff --git a/tests/builtin.sh b/tests/builtin.sh new file mode 100755 index 0000000..ac8e8f5 --- /dev/null +++ b/tests/builtin.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# without this, when OpenShift has LC_CTYPE=C.UTF-8, some tests fail +export LC_CTYPE='' + +cd source/ && \ +./configure --disable-rpath --prefix=/tmp/bogofilter && \ +make && \ +cd src/tests/ && \ +make check && \ +cd ../../ && \ +patch -p1 <../builtin-tests.patch && \ +cd src/ && \ +rm ./bogo*.o ./bf*.o bogofilter bogolexer bogotune bogoupgrade bogoutil && \ +cd tests/ && \ +make check-TESTS diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..dff9b2d --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,23 @@ +- hosts: localhost + roles: + - role: standard-test-source + tags: + - always + + - role: standard-test-basic + tags: + - atomic + - classic + required_packages: + - bogofilter + - flex + - gcc + - gsl-devel + - libdb-devel + - make + - perl-generators + - xmlto + tests: + - builtin: + dir: . + run: ./builtin.sh