main/pcre2: run tests

This commit is contained in:
Jakub Jirutka 2017-08-15 20:33:38 +02:00
parent 0ab07ed802
commit bf2eed2286

View File

@ -9,17 +9,21 @@ arch="all"
license="BSD"
depends=""
depends_dev="libedit-dev zlib-dev"
makedepends="$depends_dev"
makedepends="$depends_dev paxmark"
subpackages="$pkgname-dev $pkgname-doc $pkgname-tools
libpcre2-16:_libpcre libpcre2-32:_libpcre"
source="ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/$pkgname-$pkgver.tar.gz"
builddir="$srcdir/$pkgname-$pkgver"
case "$CARCH" in
s390x) _enable_jit="";;
*) _enable_jit="--enable-jit";;
esac
build() {
cd "$builddir"
# Note: Forced -O3 is recommended (needed?) for Julia.
[ "$CARCH" != "s390x" ] && _enable_jit="--enable-jit"
./configure \
CFLAGS="$CFLAGS -O3" \
--build=$CBUILD \
@ -36,6 +40,28 @@ build() {
make
}
# Note: RunTest and pcre2_jit_test generates some binaries in .libs that needs
# to disable MPROTECT on grsecurity kernel. That's why it's so complicated...
check() {
cd "$builddir"
local is_pax=$(grep -q PaX /proc/$$/status && echo 'yes' || echo 'no')
if [ "$is_pax" = yes ]; then
timeout -t 1 -s KILL ./RunTest 2>/dev/null || true
find .libs -type f ! -name 'lib*' | xargs paxmark m
fi
./RunTest
if [ -n "$_enable_jit" ]; then
if [ "$is_pax" = yes ]; then
timeout -t 1 -s KILL ./pcre2_jit_test >/dev/null || true
find .libs -type f ! -name 'lib*' | xargs paxmark m
fi
./pcre2_jit_test
fi
}
package() {
cd "$builddir"