Commit 0d5882d5 authored by Jakub Jirutka's avatar Jakub Jirutka

testing/lua-rapidjson: add check() function

parent 46f652b7
......@@ -2,17 +2,24 @@
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=lua-rapidjson
pkgver=0.5.0
pkgrel=2
pkgrel=3
pkgdesc="A JSON module for Lua based on the very fast RapidJSON library"
url="https://github.com/xpol/lua-rapidjson"
arch="all"
license="MIT"
makedepends="cmake rapidjson-dev"
subpackages=""
checkdepends="lua-busted lua-dromozoa-utf8"
source="$pkgname-$pkgver.tar.gz::https://github.com/xpol/$pkgname/archive/v$pkgver.tar.gz
disable-c-cxx-flag-march.patch"
builddir="$srcdir/$pkgname-$pkgver"
# luajit is not available for selected arches
case "$CARCH" in
s390x) _luajit="";;
*) checkdepends="$checkdepends luajit" _luajit="jit";;
esac
_luaversions="5.1 5.2 5.3"
for _v in $_luaversions; do
makedepends="$makedepends lua$_v-dev"
......@@ -23,8 +30,9 @@ prepare() {
default_prepare
cd "$builddir"
# Remove bundled rapidjson, use system package.
rm -r rapidjson
# Remove bundled rapidjson (use system package),
# but keep bin directory - it's needed for tests.
rm -r rapidjson/include
}
build() {
......@@ -46,6 +54,16 @@ build() {
done
}
check() {
local lver; for lver in $_luaversions $_luajit; do
cd "$builddir"/build-${lver/jit/5.1}
ln -sf ../rapidjson ../spec .
msg "Testing on lua$lver"
lua$lver /usr/bin/busted
done
}
package() {
mkdir -p "$pkgdir"
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment