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
|
#!/bin/sh
# autopkgtest check: build and run the tests that are provided by upstream.
# Run the tests that come with the upstream source.
# The whole folder test/ is copied into a temporary directory where the
# tests will be run, as some of them will write into the directory.
# (C) 2020 Pierre Gruet.
# Author: Pierre Gruet <pgt@debian.org>
set -e
SOURCEDIR=$(pwd)
WORKDIR=$(mktemp -d)
trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM
cp -r test/ $WORKDIR
cd $WORKDIR
# The classpath is made of the test sources, the build jar and the jars of
# testng and jcommander.
export CLASSPATH=$WORKDIR/test:/usr/share/java/intervalstorej.jar:/usr/share/java/testng.jar:/usr/share/java/jcommander.jar
find test -name "*.java" | xargs javac -source 1.8 -target 1.8
# Unzipping the data files used by some tests.
for F in $(find test -name "*.zip"); do
unzip $F -d ${F%/*};
done
java org.testng.TestNG $SOURCEDIR/debian/tests.xml
|