aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Guldstrand <andreas.guldstrand@gmail.com>2015-12-31 13:39:28 +0100
committerAndreas Guldstrand <andreas.guldstrand@gmail.com>2015-12-31 22:52:46 +0100
commitb58c6ba0861e6ba75f3cafef23569a44573dcdca (patch)
tree6595db0cd8c34a11cd2b0d7e0886a6a2c8ad6632
parent57c757a6c95124371c3cdf3454a2f5d5bdceb13e (diff)
downloadsbotools2-b58c6ba0861e6ba75f3cafef23569a44573dcdca.tar.xz
Add tests for build fail in dependency. See #23
-rw-r--r--t/LO-fail/nonexistentslackbuild2/README1
-rw-r--r--t/LO-fail/nonexistentslackbuild2/nonexistentslackbuild2.SlackBuild15
-rw-r--r--t/LO-fail/nonexistentslackbuild2/nonexistentslackbuild2.info10
-rwxr-xr-xt/fail.t5
4 files changed, 30 insertions, 1 deletions
diff --git a/t/LO-fail/nonexistentslackbuild2/README b/t/LO-fail/nonexistentslackbuild2/README
new file mode 100644
index 0000000..6d388bb
--- /dev/null
+++ b/t/LO-fail/nonexistentslackbuild2/README
@@ -0,0 +1 @@
+This doesn't exist!
diff --git a/t/LO-fail/nonexistentslackbuild2/nonexistentslackbuild2.SlackBuild b/t/LO-fail/nonexistentslackbuild2/nonexistentslackbuild2.SlackBuild
new file mode 100644
index 0000000..a4ced25
--- /dev/null
+++ b/t/LO-fail/nonexistentslackbuild2/nonexistentslackbuild2.SlackBuild
@@ -0,0 +1,15 @@
+#!/bin/bash
+PRGNAM="nonexistentslackbuild2"
+VERSION=${VERSION:-1.0}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+TMP=${TMP:-/tmp/SBo}
+OUTPUT=${OUTPUT:-/tmp}
+
+mkdir -p $TMP/$PRGNAM-$VERSION
+cp README $TMP/$PRGNAM-$VERSION
+mkdir -p $OUTPUT/package-$PRGNAM/usr/doc/$PRGNAM-$VERSION
+cp README $OUTPUT/package-$PRGNAM/usr/doc/$PRGNAM-$VERSION
+cd $OUTPUT/package-$PRGNAM
+
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-noarch-$BUILD$TAG.tgz
diff --git a/t/LO-fail/nonexistentslackbuild2/nonexistentslackbuild2.info b/t/LO-fail/nonexistentslackbuild2/nonexistentslackbuild2.info
new file mode 100644
index 0000000..ca9cc56
--- /dev/null
+++ b/t/LO-fail/nonexistentslackbuild2/nonexistentslackbuild2.info
@@ -0,0 +1,10 @@
+PRGNAM="nonexistentslackbuild2"
+VERSION="1.0"
+HOMEPAGE="http://www.example.com"
+DOWNLOAD="http://www.pastemobile.org/perf.dummy"
+MD5SUM="9cba6c70fb57a22a155073d54748b614"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES="failingslackbuild"
+MAINTAINER="Andreas Guldstrand"
+EMAIL="doesnt@matter.org"
diff --git a/t/fail.t b/t/fail.t
index 219a0cc..8343bc2 100755
--- a/t/fail.t
+++ b/t/fail.t
@@ -11,7 +11,7 @@ use lib "$RealBin/../SBO-Lib/lib";
use Test::Execute;
if ($ENV{TEST_INSTALL}) {
- plan tests => 2;
+ plan tests => 3;
} else {
plan skip_all => 'Only run these tests if TEST_INSTALL=1';
}
@@ -71,6 +71,9 @@ SKIP: {
script (qw/ sboinstall failingdownload /, { input => "y\ny\nn", expected => qr!Failures:\n failingdownload: Unable to wget http://www[.]pastemobile[.]org/perf[.]dummy[.]fail[.]\n!, exit => 5 });
}
+# 3: Failing dependency
+script (qw/ sboinstall nonexistentslackbuild2 /, { input => "y\ny\ny\nn", expected => qr/Failures:\n failingslackbuild: failingslackbuild.SlackBuild return non-zero\n\z/, exit => 3 });
+
# Cleanup
END {
set_lo('delete');