diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/libremakepkg-test.sh | 21 | ||||
-rw-r--r-- | test/libremakepkg.d/PKGBUILD-pkgver | 23 |
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 +} |