summaryrefslogtreecommitdiffstats
path: root/debian/tests/junit-subsequentcheck
blob: 2829f3c0c8fa7335200f0a7aa33395644b271399 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
# autopkgtest check: Run junit base tests against an installed version of LibreOffice
# (C) 2013 Canonical Ltd.
# (c) 2015-2017 Software in the Public Interest, Inc.
# Authors: Bjoern Michaelsen <bjoern.michaelsen@canonical.com>
#          Rene Engelhard <rene@debian.org>

set -e
set -E

# skip on Zero using architectures
if java -version 2>&1 | grep -q Zero; then
	echo "Zero-using architecture. Skipping."
	exit 77
fi

SRCDIR=`pwd`
CHECK_PARALLELISM=1
if [ -n "$AUTOPKGTEST_TMP" ]; then
        WORKDIR=`mktemp -q -d -p $AUTOPKGTEST_TMP`
else
        WORKDIR=`mktemp -q -d`
fi

function unapply() {
	echo
	echo "====== Unapplying the patch ======"
	patch -p1 -R < ./debian/tests/patches/junit-subsequentcheck-standalone.diff
}

trap "unapply" ERR

echo
echo "====== Patching the tree to only build Java-based unittests against an existing installation ======"
patch -p1 < ./debian/tests/patches/junit-subsequentcheck-standalone.diff

if [ ! -f config_host.mk ]; then
	echo
	echo "====== Generating configuration ======="
	rm -f config_host.mk
	./debian/rules config_host.mk enable_report_builder=no
	sed -i 's/export OOO_JUNIT_JAR=.*/export OOO_JUNIT_JAR=\/usr\/share\/java\/junit4.jar/' config_host.mk
fi

echo
echo "====== Enabling core dumps ======"
# yes, we want core dumps and stack traces
ulimit -c unlimited || true

OOO_TEST_SOFFICE="${1:-path:/usr/lib/libreoffice/program/soffice}"

echo
echo "====== Starting subsequentcheck with ${CHECK_PARALLELISM} job against ${OOO_TEST_SOFFICE} ======"

eval `grep PLATFORMID config_host.mk`

export PARALLELISM=$CHECK_PARALLELISM
make -rk \
    OOO_TEST_SOFFICE=${OOO_TEST_SOFFICE} \
    bridges_SELECTED_BRIDGE=gcc3_$PLATFORMID \
    subsequentcheck verbose=t

unapply