diff options
-rwxr-xr-x | t/06-remove.t | 16 | ||||
-rw-r--r-- | t/LO/nonexistentslackbuild7/README | 1 | ||||
-rw-r--r-- | t/LO/nonexistentslackbuild7/nonexistentslackbuild7.SlackBuild | 15 | ||||
-rw-r--r-- | t/LO/nonexistentslackbuild7/nonexistentslackbuild7.info | 10 |
4 files changed, 41 insertions, 1 deletions
diff --git a/t/06-remove.t b/t/06-remove.t index 2793f36..a168074 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 => 7; + plan tests => 11; } else { plan skip_all => 'Only run these tests if TEST_INSTALL=1'; } @@ -21,15 +21,19 @@ sub cleanup { system(qw!/sbin/removepkg nonexistentslackbuild!); system(qw!/sbin/removepkg nonexistentslackbuild4!); system(qw!/sbin/removepkg nonexistentslackbuild5!); + system(qw!/sbin/removepkg nonexistentslackbuild7!); unlink "$RealBin/LO/nonexistentslackbuild/perf.dummy"; unlink "$RealBin/LO/nonexistentslackbuild4/perf.dummy"; unlink "$RealBin/LO/nonexistentslackbuild5/perf.dummy"; + unlink "$RealBin/LO/nonexistentslackbuild7/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/package-nonexistentslackbuild!); system(qw!rm -rf /tmp/package-nonexistentslackbuild4!); system(qw!rm -rf /tmp/package-nonexistentslackbuild5!); + system(qw!rm -rf /tmp/package-nonexistentslackbuild7!); }; } @@ -65,6 +69,16 @@ sboremove qw/ nonexistentslackbuild nonexistentslackbuild /, { input => "y\nn", sboremove 'nonexistentslackbuild', { input => "n", expected => qr/Ignoring.*Nothing to remove/s }; sboremove 'nonexistentslackbuild', { input => "y\ny", test => 0 }; +# 8-11: sboremove check that still needed sbos aren't removed +sboinstall qw/ nonexistentslackbuild4 nonexistentslackbuild7 /, { input => "y\ny\ny\ny", test => 0 }; +sboremove 'nonexistentslackbuild4', { input => "y\nn", expected => sub { ! /nonexistentslackbuild5 / } }; +TODO: { + todo_skip 'sboremove: not able to see if a dep needed by more than one installed thing is still needed', 1; + sboremove qw/ nonexistentslackbuild4 nonexistentslackbuild7 /, { input => "\n\n\n\n\n", expected => qr/nonexistentslackbuild5/ }; +} +sboremove qw/ -a nonexistentslackbuild4 /, { input => "y\nn\ny", expected => qr/nonexistentslackbuild5 : required by nonexistentslackbuild7/ }; +sboremove 'nonexistentslackbuild7', { input => "y\ny\ny", expected => qr/nonexistentslackbuild5/ }; + # Cleanup END { cleanup(); diff --git a/t/LO/nonexistentslackbuild7/README b/t/LO/nonexistentslackbuild7/README new file mode 100644 index 0000000..6d388bb --- /dev/null +++ b/t/LO/nonexistentslackbuild7/README @@ -0,0 +1 @@ +This doesn't exist! diff --git a/t/LO/nonexistentslackbuild7/nonexistentslackbuild7.SlackBuild b/t/LO/nonexistentslackbuild7/nonexistentslackbuild7.SlackBuild new file mode 100644 index 0000000..296956f --- /dev/null +++ b/t/LO/nonexistentslackbuild7/nonexistentslackbuild7.SlackBuild @@ -0,0 +1,15 @@ +#!/bin/bash +PRGNAM="nonexistentslackbuild7" +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/nonexistentslackbuild7/nonexistentslackbuild7.info b/t/LO/nonexistentslackbuild7/nonexistentslackbuild7.info new file mode 100644 index 0000000..e0ae048 --- /dev/null +++ b/t/LO/nonexistentslackbuild7/nonexistentslackbuild7.info @@ -0,0 +1,10 @@ +PRGNAM="nonexistentslackbuild7" +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="nonexistentslackbuild5" +MAINTAINER="Andreas Guldstrand" +EMAIL="doesnt@matter.org" |