diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2019-11-07 11:01:18 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2019-11-07 11:32:37 +0000 |
commit | 43fb2c012e4c8a6394e9177e48999bde4de1846a (patch) | |
tree | a885a3b4c35613eed0fbbf57b9b0c63f4e2c2818 /tests | |
parent | a8f564287e002c399ec57c1490fd80d83ff74d68 (diff) | |
download | abuild-43fb2c012e4c8a6394e9177e48999bde4de1846a.tar.gz abuild-43fb2c012e4c8a6394e9177e48999bde4de1846a.tar.bz2 abuild-43fb2c012e4c8a6394e9177e48999bde4de1846a.tar.xz abuild-43fb2c012e4c8a6394e9177e48999bde4de1846a.zip |
add basic tests using bats
Diffstat (limited to 'tests')
-rw-r--r-- | tests/abuild.bats | 11 | ||||
-rw-r--r-- | tests/testrepo/pkg1/APKBUILD | 34 |
2 files changed, 45 insertions, 0 deletions
diff --git a/tests/abuild.bats b/tests/abuild.bats new file mode 100644 index 0000000..159762d --- /dev/null +++ b/tests/abuild.bats @@ -0,0 +1,11 @@ +setup() { + export ABUILD=../abuild +} + +@test "help text" { + $ABUILD -h +} + +@test "version string" { + $ABUILD -V +} diff --git a/tests/testrepo/pkg1/APKBUILD b/tests/testrepo/pkg1/APKBUILD new file mode 100644 index 0000000..a87d7d0 --- /dev/null +++ b/tests/testrepo/pkg1/APKBUILD @@ -0,0 +1,34 @@ +# Maintainer: Natanael Copa <ncopa@alpinelinux.org> + +# test package +pkgname="pkg1" +pkgver="1.0" +pkgrel=0 +pkgdesc="Dummy test package" +url="https://gitlab.alpinelinux.org/alpine/aports" +arch="noarch" +license="MIT" +subpackages="$pkgname-dev $pkgname-doc" +source="" +builddir="$srcdir/pkg1-1.0" + +prepare() { + mkdir -p "$builddir" +} + +build() { + mkdir -p usr/include usr/bin usr/share/man/man1 + touch usr/include/$pkgname.h + touch usr/bin/$pkgname + touch usr/share/man/man1/$pkgname.1 +} + +check() { + true +} + +package() { + mkdir -p "$pkgdir" + cp -r * "$pkgdir"/ +} + |