2 # omindextest: Test omindex
4 # Copyright (C) 2019 Bruno Baruffaldi
5 # Copyright (C) 2020-2023 Olly Betts
7 # This program is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU General Public License as
9 # published by the Free Software Foundation; either version 2 of the
10 # License, or (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
24 : ${OMINDEX=./omindex}
25 : ${XAPIAN_OMEGA_PKGLIBBINDIR=.}
26 export XAPIAN_OMEGA_PKGLIBBINDIR
28 # Don't complain about memory left allocated on exit - the OS will reclaim
29 # all memory at that point.
30 LSAN_OPTIONS
=leak_check_at_exit
=0
33 # Turn off msys2's argument conversion as we shouldn't need it and it breaks
36 export MSYS2_ARG_CONV_EXCL
38 srcdir
=`echo "$0"|sed 's!/*[^/]*$!!'`
39 TEST_FILES
="$srcdir/testfiles"
40 TEST_DB
="testdatabase"
42 # Remove the database on exit unless run with `--no-clean` option.
45 *) trap 'rm -rf "$TEST_DB"' 0 1 2 13 15 ;;
48 $OMINDEX --verbose --overwrite --db "$TEST_DB" --empty-docs=index
--url=/ "$TEST_FILES"
49 for subdir
in opendoc staroffice msxml
; do
50 echo "Trying to index $subdir with omindex_libreofficekit"
51 $OMINDEX --verbose --db "$TEST_DB" --empty-docs=index
--no-delete \
52 --worker=application
/vnd.oasis.opendocument.graphics
:omindex_libreofficekit \
53 --worker=application
/vnd.oasis.opendocument.presentation
:omindex_libreofficekit \
54 --worker=application
/vnd.oasis.opendocument.presentation-template
:omindex_libreofficekit \
55 --worker=application
/vnd.oasis.opendocument.spreadsheet
:omindex_libreofficekit \
56 --worker=application
/vnd.oasis.opendocument.spreadsheet-template
:omindex_libreofficekit \
57 --worker=application
/vnd.oasis.opendocument.text
:omindex_libreofficekit \
58 --worker=application
/vnd.oasis.opendocument.text-template
:omindex_libreofficekit \
59 --worker=application
/vnd.openxmlformats-officedocument.presentationml.presentation
:omindex_libreofficekit \
60 --worker=application
/vnd.openxmlformats-officedocument.spreadsheetml.sheet
:omindex_libreofficekit \
61 --worker=application
/vnd.openxmlformats-officedocument.wordprocessingml.document
:omindex_libreofficekit \
62 --worker=application
/vnd.sun.xml.calc
:omindex_libreofficekit \
63 --worker=application
/vnd.sun.xml.calc.template
:omindex_libreofficekit \
64 --worker=application
/vnd.sun.xml.impress
:omindex_libreofficekit \
65 --worker=application
/vnd.sun.xml.impress.template
:omindex_libreofficekit \
66 --worker=application
/vnd.sun.xml.writer
:omindex_libreofficekit \
67 --worker=application
/vnd.sun.xml.writer.template
:omindex_libreofficekit \
68 --url="/lok-$subdir" "$TEST_FILES/$subdir"
70 .
/omindexcheck
"$TEST_DB"