aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Guldstrand <andreas.guldstrand@gmail.com>2016-05-02 15:38:48 +0200
committerAndreas Guldstrand <andreas.guldstrand@gmail.com>2016-05-02 15:38:48 +0200
commit8fc7b067e8585a43c0b47d8580232d00072016ef (patch)
tree3f8560cfe1bc99c3b31aaa7947ab5134cbd6ba96
parenta669651233bf2dd55b969756dff65b7f7fbfdf8f (diff)
downloadsbotools2-8fc7b067e8585a43c0b47d8580232d00072016ef.tar.xz
06-remove.t: Add test for displaying readme if %README% req
-rwxr-xr-xt/06-remove.t10
-rw-r--r--t/LO/nonexistentslackbuild8/README2
-rw-r--r--t/LO/nonexistentslackbuild8/nonexistentslackbuild8.SlackBuild15
-rw-r--r--t/LO/nonexistentslackbuild8/nonexistentslackbuild8.info10
4 files changed, 36 insertions, 1 deletions
diff --git a/t/06-remove.t b/t/06-remove.t
index a168074..40b15d8 100755
--- a/t/06-remove.t
+++ b/t/06-remove.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 => 11;
+ plan tests => 12;
} else {
plan skip_all => 'Only run these tests if TEST_INSTALL=1';
}
@@ -22,18 +22,22 @@ sub cleanup {
system(qw!/sbin/removepkg nonexistentslackbuild4!);
system(qw!/sbin/removepkg nonexistentslackbuild5!);
system(qw!/sbin/removepkg nonexistentslackbuild7!);
+ system(qw!/sbin/removepkg nonexistentslackbuild8!);
unlink "$RealBin/LO/nonexistentslackbuild/perf.dummy";
unlink "$RealBin/LO/nonexistentslackbuild4/perf.dummy";
unlink "$RealBin/LO/nonexistentslackbuild5/perf.dummy";
unlink "$RealBin/LO/nonexistentslackbuild7/perf.dummy";
+ unlink "$RealBin/LO/nonexistentslackbuild8/perf.dummy";
system(qw!rm -rf /tmp/SBo/nonexistentslackbuild-1.0!);
system(qw!rm -rf /tmp/SBo/nonexistentslackbuild4-1.0!);
system(qw!rm -rf /tmp/SBo/nonexistentslackbuild5-1.0!);
system(qw!rm -rf /tmp/SBo/nonexistentslackbuild7-1.0!);
+ system(qw!rm -rf /tmp/SBo/nonexistentslackbuild8-1.0!);
system(qw!rm -rf /tmp/package-nonexistentslackbuild!);
system(qw!rm -rf /tmp/package-nonexistentslackbuild4!);
system(qw!rm -rf /tmp/package-nonexistentslackbuild5!);
system(qw!rm -rf /tmp/package-nonexistentslackbuild7!);
+ system(qw!rm -rf /tmp/package-nonexistentslackbuild8!);
};
}
@@ -79,6 +83,10 @@ TODO: {
sboremove qw/ -a nonexistentslackbuild4 /, { input => "y\nn\ny", expected => qr/nonexistentslackbuild5 : required by nonexistentslackbuild7/ };
sboremove 'nonexistentslackbuild7', { input => "y\ny\ny", expected => qr/nonexistentslackbuild5/ };
+# 12: sboremove shows readme for %README% dep
+sboinstall 'nonexistentslackbuild8', { input => "y\ny", test => 0 };
+sboremove 'nonexistentslackbuild8', { input => "y\ny\ny", expected => qr/But has to be read/ };
+
# Cleanup
END {
cleanup();
diff --git a/t/LO/nonexistentslackbuild8/README b/t/LO/nonexistentslackbuild8/README
new file mode 100644
index 0000000..61f9c99
--- /dev/null
+++ b/t/LO/nonexistentslackbuild8/README
@@ -0,0 +1,2 @@
+This doesn't exist!
+But has to be read
diff --git a/t/LO/nonexistentslackbuild8/nonexistentslackbuild8.SlackBuild b/t/LO/nonexistentslackbuild8/nonexistentslackbuild8.SlackBuild
new file mode 100644
index 0000000..99493a1
--- /dev/null
+++ b/t/LO/nonexistentslackbuild8/nonexistentslackbuild8.SlackBuild
@@ -0,0 +1,15 @@
+#!/bin/bash
+PRGNAM="nonexistentslackbuild8"
+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/nonexistentslackbuild8/nonexistentslackbuild8.info b/t/LO/nonexistentslackbuild8/nonexistentslackbuild8.info
new file mode 100644
index 0000000..6edc45a
--- /dev/null
+++ b/t/LO/nonexistentslackbuild8/nonexistentslackbuild8.info
@@ -0,0 +1,10 @@
+PRGNAM="nonexistentslackbuild8"
+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"