From 240ad5ce4a82c47dabb1707e564244ae0aa580cf Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Wed, 23 May 2018 03:49:44 -0500 Subject: Add rudimentary test suite for abuild and newapkbuild --- tests/abuild/check1/APKBUILD | 22 ++++++++++++++++++++++ tests/abuild/check2/APKBUILD | 22 ++++++++++++++++++++++ tests/abuild/check2/simple.txt | 1 + tests/abuild/checkroot1/APKBUILD | 21 +++++++++++++++++++++ tests/abuild/checkroot1/simple.txt | 1 + tests/abuild/verify1/APKBUILD | 19 +++++++++++++++++++ tests/abuild/verify1/simple.txt | 1 + tests/abuild/verify2/APKBUILD | 19 +++++++++++++++++++ tests/abuild/verify2/simple.txt | 1 + tests/newapkbuild/.dirkeep | 0 10 files changed, 107 insertions(+) create mode 100644 tests/abuild/check1/APKBUILD create mode 100644 tests/abuild/check2/APKBUILD create mode 100644 tests/abuild/check2/simple.txt create mode 100644 tests/abuild/checkroot1/APKBUILD create mode 100644 tests/abuild/checkroot1/simple.txt create mode 100644 tests/abuild/verify1/APKBUILD create mode 100644 tests/abuild/verify1/simple.txt create mode 100644 tests/abuild/verify2/APKBUILD create mode 100644 tests/abuild/verify2/simple.txt create mode 100644 tests/newapkbuild/.dirkeep (limited to 'tests') diff --git a/tests/abuild/check1/APKBUILD b/tests/abuild/check1/APKBUILD new file mode 100644 index 0000000..aea48f3 --- /dev/null +++ b/tests/abuild/check1/APKBUILD @@ -0,0 +1,22 @@ +pkgname=check1 +pkgver=1.0 +pkgrel=0 +pkgdesc="Test package: check1" +url="https://adelielinux.org/" +arch="all" +options="" +license="NCSA" +depends="" +makedepends="" +install="" +subpackages="" +source="" + +check() { + mkdir -p "$srcdir" + touch "$srcdir"/checked +} + +package() { + return 0 +} diff --git a/tests/abuild/check2/APKBUILD b/tests/abuild/check2/APKBUILD new file mode 100644 index 0000000..0350b1d --- /dev/null +++ b/tests/abuild/check2/APKBUILD @@ -0,0 +1,22 @@ +pkgname=check2 +pkgver=1.0 +pkgrel=0 +pkgdesc="Test package: check2" +url="https://adelielinux.org/" +arch="all" +options="" +license="NCSA" +depends="" +makedepends="" +install="" +subpackages="" +source="" + +check() { + # fail on purpose + return 1 +} + +package() { + return 0 +} diff --git a/tests/abuild/check2/simple.txt b/tests/abuild/check2/simple.txt new file mode 100644 index 0000000..d7d2855 --- /dev/null +++ b/tests/abuild/check2/simple.txt @@ -0,0 +1 @@ +Very simple file. diff --git a/tests/abuild/checkroot1/APKBUILD b/tests/abuild/checkroot1/APKBUILD new file mode 100644 index 0000000..6165c55 --- /dev/null +++ b/tests/abuild/checkroot1/APKBUILD @@ -0,0 +1,21 @@ +pkgname=checkroot1 +pkgver=1.0 +pkgrel=0 +pkgdesc="Test package: checkroot1" +url="https://adelielinux.org/" +arch="all" +options="!checkroot" +license="NCSA" +depends="" +makedepends="" +install="" +subpackages="" +source="" + +check() { + [ $UID -ne 0 ] || return 1 +} + +package() { + return 0 +} diff --git a/tests/abuild/checkroot1/simple.txt b/tests/abuild/checkroot1/simple.txt new file mode 100644 index 0000000..d7d2855 --- /dev/null +++ b/tests/abuild/checkroot1/simple.txt @@ -0,0 +1 @@ +Very simple file. diff --git a/tests/abuild/verify1/APKBUILD b/tests/abuild/verify1/APKBUILD new file mode 100644 index 0000000..852d60d --- /dev/null +++ b/tests/abuild/verify1/APKBUILD @@ -0,0 +1,19 @@ +pkgname=verify1 +pkgver=1.0 +pkgrel=0 +pkgdesc="Test package: verify1" +url="https://adelielinux.org/" +arch="all" +options="" +license="NCSA" +depends="" +makedepends="" +install="" +subpackages="" +source="simple.txt" + +package() { + return 0 +} + +sha512sums="c4b863ff80b759fdfcf66c1d7c36ac0b161ea5e2d32505ec9142f75810db1f5608e29cac18d1888796eb1323c20e939d88a12099a6b5968dd485b53fe0ee1754 simple.txt" diff --git a/tests/abuild/verify1/simple.txt b/tests/abuild/verify1/simple.txt new file mode 100644 index 0000000..d7d2855 --- /dev/null +++ b/tests/abuild/verify1/simple.txt @@ -0,0 +1 @@ +Very simple file. diff --git a/tests/abuild/verify2/APKBUILD b/tests/abuild/verify2/APKBUILD new file mode 100644 index 0000000..9c1977e --- /dev/null +++ b/tests/abuild/verify2/APKBUILD @@ -0,0 +1,19 @@ +pkgname=verify2 +pkgver=1.0 +pkgrel=0 +pkgdesc="Test package: verify2" +url="https://adelielinux.org/" +arch="all" +options="" +license="NCSA" +depends="" +makedepends="" +install="" +subpackages="" +source="simple.txt" + +package() { + return 0 +} + +sha512sums="c4b863ff80b759fdfcf66c1d7c36ac0b161ea5e2d32505ec9142f75810db1f5608e29cac18d1888796eb1323c20e939d88a12099a6b5968dd485b53fe0ee1750 simple.txt" diff --git a/tests/abuild/verify2/simple.txt b/tests/abuild/verify2/simple.txt new file mode 100644 index 0000000..d7d2855 --- /dev/null +++ b/tests/abuild/verify2/simple.txt @@ -0,0 +1 @@ +Very simple file. diff --git a/tests/newapkbuild/.dirkeep b/tests/newapkbuild/.dirkeep new file mode 100644 index 0000000..e69de29 -- cgit v1.2.3-70-g09d2