| 1 |
#!/bin/bash |
| 2 |
# autopkgtest check: Run junit base tests against an installed version of LibreOffice |
| 3 |
# (c) 2021 Software in the Public Interest, Inc. |
| 4 |
# Authors: Rene Engelhard <[email protected]> |
| 5 |
|
| 6 |
set -e |
| 7 |
set -E |
| 8 |
|
| 9 |
SRCDIR=`pwd` |
| 10 |
CHECK_PARALLELISM=1 |
| 11 |
if [ -n "$AUTOPKGTEST_TMP" ]; then |
| 12 |
WORKDIR=`mktemp -q -d -p $AUTOPKGTEST_TMP` |
| 13 |
else |
| 14 |
WORKDIR=`mktemp -q -d` |
| 15 |
fi |
| 16 |
|
| 17 |
function unapply() { |
| 18 |
cd $SRCDIR |
| 19 |
echo |
| 20 |
echo "====== Unapplying the patches ======" |
| 21 |
patch -p1 -R < ./debian/tests/patches/cppunit-standalone.diff |
| 22 |
} |
| 23 |
|
| 24 |
trap "unapply" ERR |
| 25 |
|
| 26 |
if [ -f $AUTOPKGTEST_TMP/build-tests-skipped ]; then exit 77; fi |
| 27 |
|
| 28 |
echo |
| 29 |
echo "====== Patching the tree to only build the unittests against an existing installation ======" |
| 30 |
patch -p1 < ./debian/tests/patches/cppunit-standalone.diff |
| 31 |
|
| 32 |
echo |
| 33 |
echo "====== Enabling core dumps ======" |
| 34 |
# yes, we want core dumps and stack traces |
| 35 |
ulimit -c unlimited || true |
| 36 |
|
| 37 |
echo |
| 38 |
echo "====== Starting subsequentcheck with ${CHECK_PARALLELISM} job ======" |
| 39 |
|
| 40 |
cd $SRCDIR |
| 41 |
|
| 42 |
# all modules containing subsequent(test|check). |
| 43 |
# Filter out: |
| 44 |
# - odk: already tested by odk-build-examples and odk/util/check.pl |
| 45 |
# - the junit tests - which are ran in an own test - by setting OOO_JUNIT_JAR to nothing (as --without-junit would do) |
| 46 |
# - solenv: no need to test gbuild2json... |
| 47 |
# - smoketest: done in the smoketest test |
| 48 |
export PARALLELISM=$CHECK_PARALLELISM |
| 49 |
for i in `grep subsequent */*.mk | cut -d"/" -f1 | grep -E -v '(odk|smoketest|solenv)' | sort | uniq | xargs`; do |
| 50 |
echo |
| 51 |
echo "====== Running subsequentcheck in module $i ======"; \ |
| 52 |
cd $i && \ |
| 53 |
make -rk subsequentcheck \ |
| 54 |
OOO_JUNIT_JAR= \ |
| 55 |
INSTDIR=/usr/lib/libreoffice \ |
| 56 |
verbose=t; \ |
| 57 |
cd ..;\ |
| 58 |
done |
| 59 |
|
| 60 |
unapply |
| 61 |
|