diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2017-03-12 22:52:36 +0100 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2017-03-12 22:53:46 +0100 |
commit | 3279667810debcc7c1db78407e60ae0b1cc7ed03 (patch) | |
tree | 3d65f49af3ab0b16dd621abffb2e4933a26956a3 /community/lua-mpack | |
parent | 5515de0c97828b3a1a4a9c227fca8228ea5b08af (diff) | |
download | aports-3279667810debcc7c1db78407e60ae0b1cc7ed03.tar.bz2 aports-3279667810debcc7c1db78407e60ae0b1cc7ed03.tar.xz |
community/lua-mpack: add check function
Diffstat (limited to 'community/lua-mpack')
-rw-r--r-- | community/lua-mpack/APKBUILD | 23 | ||||
-rw-r--r-- | community/lua-mpack/skip-memleak-test.patch | 20 |
2 files changed, 38 insertions, 5 deletions
diff --git a/community/lua-mpack/APKBUILD b/community/lua-mpack/APKBUILD index 85648d2951..45bba241b8 100644 --- a/community/lua-mpack/APKBUILD +++ b/community/lua-mpack/APKBUILD @@ -3,15 +3,17 @@ pkgname=lua-mpack _pkgname=libmpack pkgver=1.0.4 -pkgrel=0 +pkgrel=1 pkgdesc="Libmpack bindings for Lua" url="https://github.com/tarruda/libmpack" arch="all" license="MIT" depends="" makedepends="" +checkdepends="lua-busted" subpackages="" -source="$_pkgname-$pkgver.tar.gz::https://github.com/tarruda/$_pkgname/archive/$pkgver.tar.gz" +source="$_pkgname-$pkgver.tar.gz::https://github.com/tarruda/$_pkgname/archive/$pkgver.tar.gz + skip-memleak-test.patch" builddir="$srcdir/$_pkgname-$pkgver" _luaversions="5.1 5.2 5.3" @@ -39,6 +41,18 @@ build() { done } +check() { + local lver; for lver in $_luaversions; do + msg "Testing on Lua $lver..." + make -C "$builddir-$lver"/binding/lua \ + USE_SYSTEM_LUA=yes \ + LUA=/usr/bin/lua$lver \ + LUAROCKS=/bin/false \ + BUSTED=/usr/bin/busted-$lver \ + test || return 1 + done +} + package() { mkdir -p "$pkgdir" } @@ -55,6 +69,5 @@ _subpackage() { install } -md5sums="cf30db534d61ce5f64a96533fe30e06a libmpack-1.0.4.tar.gz" -sha256sums="0a5d69f3966b31d14faddbd81db53b543fb092c711250ecb0aa5e22d060aa080 libmpack-1.0.4.tar.gz" -sha512sums="8e40a562faf8b62137dec0733cbb9006fa7054e5a47bdd128fb4dfd676fac4e4385a23c3d908a4ce2edd65d673db25916695fa74bc08c5316b0c80e571a7442c libmpack-1.0.4.tar.gz" +sha512sums="8e40a562faf8b62137dec0733cbb9006fa7054e5a47bdd128fb4dfd676fac4e4385a23c3d908a4ce2edd65d673db25916695fa74bc08c5316b0c80e571a7442c libmpack-1.0.4.tar.gz +380603230e65b8b4adec0153aa23089612f0923666b44ca503a4217c1125c5f8cbac9eb550a94add8fa2d5ac40464689302c8e79e5a087f408707ae21eb9faa9 skip-memleak-test.patch" diff --git a/community/lua-mpack/skip-memleak-test.patch b/community/lua-mpack/skip-memleak-test.patch new file mode 100644 index 0000000000..1f8b287dd7 --- /dev/null +++ b/community/lua-mpack/skip-memleak-test.patch @@ -0,0 +1,20 @@ +This test requires binary to be built in debug mode. +--- a/binding/lua/test.lua ++++ b/binding/lua/test.lua +@@ -276,16 +276,6 @@ + end) + end) + +- it('should not leak memory', function() +- -- get the path to the lua interpreter, taken from +- -- http://stackoverflow.com/a/18304231 +- local i_min = 0 +- while arg[ i_min ] do i_min = i_min - 1 end +- i_min = i_min + 1 +- local res = io.popen(arg[i_min]..' leak_test.lua'):read('*a') +- assert.are_same('ok\n', res) +- end) +- + describe('is_bin option', function() + it('controls if strings are serialized to BIN or STR', function() + local isbin = false |