From 6e3bdf742158e12fbfaa4fd4e17e95266302b10a Mon Sep 17 00:00:00 2001 From: dockes Date: Wed, 14 Feb 2007 08:16:47 +0000 Subject: [PATCH] *** empty log message *** --- tests/Maildir/Maildir.sh | 19 +++++++++++++++++++ tests/Maildir/Maildir.txt | 1 + tests/Maildir1/Maildir1.sh | 13 +++++++++++++ tests/Maildir1/Maildir1.txt | 3 +++ tests/andor/andor.sh | 12 ++++++++++++ tests/andor/andor.txt | 4 ++++ tests/badsuffs/badsuffs.sh | 13 +++++++++++++ tests/badsuffs/badsuffs.txt | 2 ++ tests/badsuffs1/badsuffs1.sh | 13 +++++++++++++ tests/badsuffs1/badsuffs1.txt | 8 ++++++++ tests/runtests.sh | 25 +++++++++++++++++++++++++ tests/shared.sh | 31 +++++++++++++++++++++++++++++++ tests/skipped/skipped.sh | 12 ++++++++++++ tests/skipped/skipped.txt | 3 +++ 14 files changed, 159 insertions(+) create mode 100755 tests/Maildir/Maildir.sh create mode 100644 tests/Maildir/Maildir.txt create mode 100755 tests/Maildir1/Maildir1.sh create mode 100644 tests/Maildir1/Maildir1.txt create mode 100755 tests/andor/andor.sh create mode 100644 tests/andor/andor.txt create mode 100755 tests/badsuffs/badsuffs.sh create mode 100644 tests/badsuffs/badsuffs.txt create mode 100755 tests/badsuffs1/badsuffs1.sh create mode 100644 tests/badsuffs1/badsuffs1.txt create mode 100644 tests/runtests.sh create mode 100644 tests/shared.sh create mode 100755 tests/skipped/skipped.sh create mode 100644 tests/skipped/skipped.txt diff --git a/tests/Maildir/Maildir.sh b/tests/Maildir/Maildir.sh new file mode 100755 index 00000000..4eeaa22f --- /dev/null +++ b/tests/Maildir/Maildir.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +topdir=`dirname $0`/.. +. $topdir/shared.sh + +initvariables $0 + +# See how many Maildir files were indexed. All Maildir messages have had +# MAILDIR_UNIQUEXXX added at the end of the 'Subject: ' line. Note that +# because of the attachments the relationship of file count to result count +# is not trivial. We do not use recollq here because any change in the +# indexing process is going to change the order of results. + +xadump -d $RECOLL_CONFDIR/xapiandb -t maildir_uniquexxx -F | \ + grep FreqFor > $mystdout 2> $mystderr + +diff -w ${myname}.txt $mystdout > $mydiffs 2>&1 + +checkresult diff --git a/tests/Maildir/Maildir.txt b/tests/Maildir/Maildir.txt new file mode 100644 index 00000000..334fd3e7 --- /dev/null +++ b/tests/Maildir/Maildir.txt @@ -0,0 +1 @@ +FreqFor maildir_uniquexxx : 692 diff --git a/tests/Maildir1/Maildir1.sh b/tests/Maildir1/Maildir1.sh new file mode 100755 index 00000000..72cdb267 --- /dev/null +++ b/tests/Maildir1/Maildir1.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +topdir=`dirname $0`/.. +. $topdir/shared.sh + +initvariables $0 + +# This is supposed to find an html attachment +recollq '"EMI is releasing albums for download"' > $mystdout 2> $mystderr + +diff -w ${myname}.txt $mystdout > $mydiffs 2>&1 + +checkresult diff --git a/tests/Maildir1/Maildir1.txt b/tests/Maildir1/Maildir1.txt new file mode 100644 index 00000000..afcc8fcd --- /dev/null +++ b/tests/Maildir1/Maildir1.txt @@ -0,0 +1,3 @@ +Recoll query: ((emi PHRASE 6 is PHRASE 6 releasing PHRASE 6 albums PHRASE 6 for PHRASE 6 download)) +1 results +100% text/html 10825 bytes [file:///home/dockes/projets/fulltext/testrecoll/Maildir/a.tager/cur/1134632779.000001.mbox:2,S] [00/05/05 - Mix&Match Meeting in the Zydeco room] diff --git a/tests/andor/andor.sh b/tests/andor/andor.sh new file mode 100755 index 00000000..72ccc51c --- /dev/null +++ b/tests/andor/andor.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +topdir=`dirname $0`/.. +. $topdir/shared.sh + +initvariables $0 + +recollq 'Beatles OR Lennon Live OR Unplugged' > $mystdout 2> $mystderr + +diff -w ${myname}.txt $mystdout > $mydiffs 2>&1 + +checkresult diff --git a/tests/andor/andor.txt b/tests/andor/andor.txt new file mode 100644 index 00000000..500ff7ed --- /dev/null +++ b/tests/andor/andor.txt @@ -0,0 +1,4 @@ +Recoll query: (((beatles:(wqf=11) OR lennon:(wqf=11)) AND (live:(wqf=11) OR unplugged:(wqf=11)))) +2 results +53% text/plain 18 bytes [file:///home/dockes/projets/fulltext/testrecoll/andor/bu.txt] [bu.txt] +46% text/plain 12 bytes [file:///home/dockes/projets/fulltext/testrecoll/andor/leli.txt] [leli.txt] diff --git a/tests/badsuffs/badsuffs.sh b/tests/badsuffs/badsuffs.sh new file mode 100755 index 00000000..ba657e4d --- /dev/null +++ b/tests/badsuffs/badsuffs.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +topdir=`dirname $0`/.. +. $topdir/shared.sh + +initvariables $0 + +# Data in text files with skipped suffixes should not be indexed +recollq Badsuffixes_unique > $mystdout 2> $mystderr + +diff -w ${myname}.txt $mystdout > $mydiffs 2>&1 + +checkresult diff --git a/tests/badsuffs/badsuffs.txt b/tests/badsuffs/badsuffs.txt new file mode 100644 index 00000000..0d2be0ac --- /dev/null +++ b/tests/badsuffs/badsuffs.txt @@ -0,0 +1,2 @@ +Recoll query: (badsuffixes_unique:(wqf=11)) +0 results diff --git a/tests/badsuffs1/badsuffs1.sh b/tests/badsuffs1/badsuffs1.sh new file mode 100755 index 00000000..c692eeae --- /dev/null +++ b/tests/badsuffs1/badsuffs1.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +topdir=`dirname $0`/.. +. $topdir/shared.sh + +initvariables $0 + +# File names for files with skipped suffixes should be indexed +recollq Badsufffilename > $mystdout 2> $mystderr + +diff -w ${myname}.txt $mystdout > $mydiffs 2>&1 + +checkresult diff --git a/tests/badsuffs1/badsuffs1.txt b/tests/badsuffs1/badsuffs1.txt new file mode 100644 index 00000000..971f5018 --- /dev/null +++ b/tests/badsuffs1/badsuffs1.txt @@ -0,0 +1,8 @@ +Recoll query: (badsufffilename:(wqf=11)) +6 results +99% 19 bytes [file:///home/dockes/projets/fulltext/testrecoll/badsuffs/badsufffilename.tgz] [badsufffilename.tgz] +99% 19 bytes [file:///home/dockes/projets/fulltext/testrecoll/badsuffs/badsufffilename.tar.bz2] [badsufffilename.tar.bz2] +99% 19 bytes [file:///home/dockes/projets/fulltext/testrecoll/badsuffs/badsufffilename.log.gz] [badsufffilename.log.gz] +99% 19 bytes [file:///home/dockes/projets/fulltext/testrecoll/badsuffs/badsufffilename.md5] [badsufffilename.md5] +99% 19 bytes [file:///home/dockes/projets/fulltext/testrecoll/badsuffs/badsufffilename.tar.gz] [badsufffilename.tar.gz] +99% 19 bytes [file:///home/dockes/projets/fulltext/testrecoll/badsuffs/badsufffilename.tbz] [badsufffilename.tbz] diff --git a/tests/runtests.sh b/tests/runtests.sh new file mode 100644 index 00000000..19855b13 --- /dev/null +++ b/tests/runtests.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +if test ! -f shared.sh ; then + echo must be run in the top test directory + exit 1 +fi + +. shared.sh + +# Yes, we could/should use the $toptmp from shared.sh here, but what if +# this is unset ? +toptmp=${TMPDIR:-/tmp}/recolltsttmp +if test -d "$toptmp" ; then + rm -rf $toptmp/* +else + mkdir $toptmp || fatal cant create temp dir $toptmp +fi + +dirs=`ls -F | grep / | grep -v CVS` + +for dir in $dirs ; do + cd $dir + sh `basename $dir`.sh + cd .. +done diff --git a/tests/shared.sh b/tests/shared.sh new file mode 100644 index 00000000..bdb4a3fe --- /dev/null +++ b/tests/shared.sh @@ -0,0 +1,31 @@ +# @(#$Id: shared.sh,v 1.1 2007-02-14 08:16:47 dockes Exp $ (C) 2006 J.F.Dockes + +# shared code and variables for all tests + +RECOLL_CONFDIR=/home/dockes/projets/fulltext/testrecoll/config +export RECOLL_CONFDIR + +# Call this with the script's $0 as argument +initvariables() { + toptmp=${TMPDIR:-/tmp}/recolltsttmp + myname=`basename $1 .sh` + mystderr=$toptmp/${myname}.err + mystdout=$toptmp/${myname}.out + mydiffs=$toptmp/${myname}.diffs +} + +fatal () { + echo $* + exit 1 +} + +checkresult() { + if test -s "$mydiffs" ; then + fatal $myname FAILED + else + rm -f $mydiffs + exit 0 + fi +} + + diff --git a/tests/skipped/skipped.sh b/tests/skipped/skipped.sh new file mode 100755 index 00000000..166fe8ec --- /dev/null +++ b/tests/skipped/skipped.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +topdir=`dirname $0`/.. +. $topdir/shared.sh + +initvariables $0 + +recollq shouldbeSkippedUnique > $mystdout 2> $mystderr + +diff -w ${myname}.txt $mystdout > $mydiffs 2>&1 + +checkresult diff --git a/tests/skipped/skipped.txt b/tests/skipped/skipped.txt new file mode 100644 index 00000000..8cc6ea2f --- /dev/null +++ b/tests/skipped/skipped.txt @@ -0,0 +1,3 @@ +Recoll query: ((shouldbeskippedunique:(wqf=11) OR shouldbeskippeduniqu)) +1 results +61% text/plain 48 bytes [file:///home/dockes/projets/fulltext/testrecoll/skipped/rlyskipped/shouldnotbeskipped.txt] [shouldnotbeskipped.txt]