summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2018-07-31 14:25:35 -0400
committerLuke Shumaker <lukeshu@lukeshu.com>2018-08-03 13:06:31 -0400
commit044b4e16b9bdd2b3c6622af6216888ddf0a16644 (patch)
treee5a9bd16758dfda1ba4ffd8fde6c711001ee6007
parentaf1549f2aec7ade0f563a6318a9ab1b9790ba4d9 (diff)
test: libremakepkg: Add some failing tests [ci-skip]
-rw-r--r--test/libremakepkg-test.sh21
-rw-r--r--test/libremakepkg.d/PKGBUILD-pkgver23
2 files changed, 42 insertions, 2 deletions
diff --git a/test/libremakepkg-test.sh b/test/libremakepkg-test.sh
index 6fa7962..0d24b43 100644
--- a/test/libremakepkg-test.sh
+++ b/test/libremakepkg-test.sh
@@ -16,13 +16,15 @@ it_builds_a_trivial_package() {
[[ -f $(echo libretools-hello-1.0-1-any.pkg.tar.?z) ]]
}
-it_enables_networking_during_prepare() {
+it_disables_networking_during_prepare() {
require network sudo || return 0
cp libremakepkg.d/PKGBUILD-netprepare "$tmpdir/PKGBUILD"
cd "$tmpdir"
libremessages msg 'Creating a chroot, may take a few minutes' &>/dev/tty
- testsudo libremakepkg -l "$roundup_test_name"
+ not testsudo libremakepkg -l "$roundup_test_name"
+ not [[ -f $(echo libretools-netprepare-1.0-1-any.pkg.tar.?z) ]]
+ testsudo libremakepkg -l "$roundup_test_name" -N
[[ -f $(echo libretools-netprepare-1.0-1-any.pkg.tar.?z) ]]
}
@@ -203,3 +205,18 @@ it_fails_with_bad_signatures() {
libremessages msg 'Creating a chroot, may take a few minutes' &>/dev/tty
not testsudo libremakepkg -l "$roundup_test_name"
}
+
+it_does_not_run_pkgver() {
+ require network sudo || return 0
+
+ cp libremakepkg.d/PKGBUILD-pkgver "$tmpdir/PKGBUILD"
+ pushd "$tmpdir"
+
+ libremessages msg 'Creating a chroot, may take a few minutes' &>/dev/tty
+ testsudo libremakepkg -l "$roundup_test_name"
+
+ [[ -f $(echo libretools-pkgver-1-1-any.pkg.tar.?z) ]]
+ not [[ -f $(echo libretools-pkgver-2-1-any.pkg.tar.?z) ]]
+ popd
+ diff -u libremakepkg.d/PKGBUILD-pkgver "$tmpdir/PKGBUILD"
+}
diff --git a/test/libremakepkg.d/PKGBUILD-pkgver b/test/libremakepkg.d/PKGBUILD-pkgver
new file mode 100644
index 0000000..6b92d84
--- /dev/null
+++ b/test/libremakepkg.d/PKGBUILD-pkgver
@@ -0,0 +1,23 @@
+pkgname='libretools-pkgver'
+pkgver=1
+license=('GPL')
+url='https://parabola.nu'
+
+pkgrel=1
+arch=(any)
+depends=(sh)
+
+pkgver() {
+ echo 2
+}
+
+build() {
+ cd "$srcdir"
+ echo '#!/bin/sh' > hello.sh
+ echo 'echo Hello, world!' >> hello.sh
+}
+
+package() {
+ cd "$srcdir"
+ install -Dm755 hello.sh "$pkgdir"/usr/bin/libretools-hello
+}