aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rwxr-xr-xt/07-fail.t12
-rw-r--r--t/LO-fail/noreadmebutreadmereq/noreadmebutreadmereq.SlackBuild15
-rw-r--r--t/LO-fail/noreadmebutreadmereq/noreadmebutreadmereq.info10
3 files changed, 35 insertions, 2 deletions
diff --git a/t/07-fail.t b/t/07-fail.t
index fd81678..4329dcf 100755
--- a/t/07-fail.t
+++ b/t/07-fail.t
@@ -10,7 +10,7 @@ use lib $RealBin;
use Test::Sbotools qw/ make_slackbuilds_txt set_lo sboinstall sboremove /;
if ($ENV{TEST_INSTALL}) {
- plan tests => 19;
+ plan tests => 22;
} else {
plan skip_all => 'Only run these tests if TEST_INSTALL=1';
}
@@ -35,6 +35,7 @@ sub cleanup {
unlink "$RealBin/LO-fail/malformed-readme/perf.dummy";
unlink "$RealBin/LO-fail/malformed-slackbuild/perf.dummy";
unlink "$RealBin/LO-fail/multilibfail/perf.dummy";
+ unlink "$RealBin/LO-fail/noreadmebutreadmereq/perf.dummy";
system(qw!rm -rf /tmp/SBo/failingslackbuild-1.0!);
system(qw!rm -rf /tmp/SBo/failingslackbuild2-1.0!);
system(qw!rm -rf /tmp/SBo/failingslackbuild3-1.0!);
@@ -51,6 +52,7 @@ sub cleanup {
system(qw!rm -rf /tmp/SBo/malformed-readme-1.0!);
system(qw!rm -rf /tmp/SBo/malformed-slackbuild-1.0!);
system(qw!rm -rf /tmp/SBo/multilibfail-1.0!);
+ system(qw!rm -rf /tmp/SBo/noreadmebutreadmereq-1.0!);
system(qw!rm -rf /tmp/package-failingslackbuild!);
system(qw!rm -rf /tmp/package-failingslackbuild2!);
system(qw!rm -rf /tmp/package-failingslackbuild3!);
@@ -67,7 +69,8 @@ sub cleanup {
system(qw!rm -rf /tmp/package-malformed-readme!);
system(qw!rm -rf /tmp/package-malformed-slackbuild!);
system(qw!rm -rf /tmp/package-multilibfail!);
- system(qw!/sbin/removepkg nonexistentslackbuild2!);
+ system(qw!rm -rf /tmp/package-noreadmebutreadmereq!);
+ system(qw!/sbin/removepkg nonexistentslackbuild2 noreadmebutreadmereq!);
};
}
@@ -160,6 +163,11 @@ sboremove 'nonexistentslackbuild2', { input => "y\ny", test => 0 };
# 19: Slackbuild fails during noninteractive run
sboinstall qw/ -r failingslackbuild /, { expected => qr/Failures:\n failingslackbuild: failingslackbuild.SlackBuild return non-zero\n/, exit => 3 };
+# 20-22: Slackbuild with %README% req without a readme
+sboinstall qw/ -r noreadmebutreadmereq /;
+sboremove qw/ noreadmebutreadmereq /, { input => 'y', expected => qr/fatal script error.*open_fh/s, exit => 2 };
+sboremove qw/ noreadmebutreadmereq /, { input => "n\ny\ny", expected => qr/Display README.*Remove noreadme.*Added to remove queue.*Removing 1 pack.*noreadme.*All operations/s, exit => 0 };
+
# Cleanup
END {
cleanup();
diff --git a/t/LO-fail/noreadmebutreadmereq/noreadmebutreadmereq.SlackBuild b/t/LO-fail/noreadmebutreadmereq/noreadmebutreadmereq.SlackBuild
new file mode 100644
index 0000000..c879442
--- /dev/null
+++ b/t/LO-fail/noreadmebutreadmereq/noreadmebutreadmereq.SlackBuild
@@ -0,0 +1,15 @@
+#!/bin/bash
+PRGNAM="noreadmebutreadmereq"
+VERSION=${VERSION:-1.0}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+TMP=${TMP:-/tmp/SBo}
+OUTPUT=${OUTPUT:-/tmp}
+
+mkdir -p $TMP/$PRGNAM-$VERSION
+echo "foo" > $TMP/$PRGNAM-$VERSION/README
+mkdir -p $OUTPUT/package-$PRGNAM/usr/doc/$PRGNAM-$VERSION
+echo "foo" > $OUTPUT/package-$PRGNAM/usr/doc/$PRGNAM-$VERSION/README
+cd $OUTPUT/package-$PRGNAM
+
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-noarch-$BUILD$TAG.tgz
diff --git a/t/LO-fail/noreadmebutreadmereq/noreadmebutreadmereq.info b/t/LO-fail/noreadmebutreadmereq/noreadmebutreadmereq.info
new file mode 100644
index 0000000..dbeb966
--- /dev/null
+++ b/t/LO-fail/noreadmebutreadmereq/noreadmebutreadmereq.info
@@ -0,0 +1,10 @@
+PRGNAM="noreadmebutreadmereq"
+VERSION="1.0"
+HOMEPAGE="http://www.example.com"
+DOWNLOAD="http://pink-mist.github.io/sbotools/testing/perf.dummy"
+MD5SUM="9cba6c70fb57a22a155073d54748b614"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES="%README%"
+MAINTAINER="Andreas Guldstrand"
+EMAIL="doesnt@matter.org"