diff options
author | Andreas Guldstrand <andreas.guldstrand@gmail.com> | 2015-12-31 21:15:54 +0100 |
---|---|---|
committer | Andreas Guldstrand <andreas.guldstrand@gmail.com> | 2015-12-31 22:52:46 +0100 |
commit | 73f3bfd086b404f50cf7de634411b56b1ce8bb69 (patch) | |
tree | 195c15d10afad1f5c0c1faa7e68ad15641f9922e /t/fail.t | |
parent | a92a2db61b4eed5d3871340c2985ccbc15aac4ae (diff) | |
download | sbotools2-73f3bfd086b404f50cf7de634411b56b1ce8bb69.tar.xz |
Add multilib fail tests. See #23
Diffstat (limited to 't/fail.t')
-rwxr-xr-x | t/fail.t | 30 |
1 files changed, 29 insertions, 1 deletions
@@ -11,11 +11,12 @@ use lib "$RealBin/../SBO-Lib/lib"; use Test::Execute; if ($ENV{TEST_INSTALL}) { - plan tests => 13; + plan tests => 16; } else { plan skip_all => 'Only run these tests if TEST_INSTALL=1'; } $ENV{TEST_ONLINE} //= 0; +$ENV{TEST_MULTILIB} //= 0; $path = "$RealBin/../"; @@ -141,6 +142,33 @@ script (qw/ sboinstall malformed-readme /, { expected => "A fatal script error h script (qw/ sboinstall malformed-slackbuild /, { input => "y\ny", expected => qr!Failures:\n malformed-slackbuild: Unable to backup \Q$RealBin/LO-fail/malformed-slackbuild/malformed-slackbuild.SlackBuild to $RealBin/LO-fail/malformed-slackbuild/malformed-slackbuild.SlackBuild.orig\E!, exit => 6 }); +# 14: Multilib fails - no multilib +SKIP: { + skip "No multilib test only valid when TEST_MULTILIB=0", 1 unless $ENV{TEST_MULTILIB} == 0; + skip "/etc/profile.d/32dev.sh exists", 1 if -e "/etc/profile.d/32dev.sh"; + + script (qw/ sboinstall -p nonexistentslackbuild /, { input => "y\ny\ny", expected => qr/Failures:\n nonexistentslackbuild-compat32: compat32 requires multilib[.]\n/, exit => 9 }); + script (qw/ sboremove nonexistentslackbuild /, { input => "y\ny", test => 0 }); +} + +# 15: Multilib fails - no convertpkg +SKIP: { + skip "No convertpkg test only valid when TEST_MULTILIB=1", 1 unless $ENV{TEST_MULTILIB} == 1; + skip "/etc/profile.d/32dev.sh doesn't exist", 1 unless -e "/etc/profile.d/32dev.sh"; + skip "/usr/sbin/convertpkg-compat32 exists", 1 if -e "/usr/sbin/convertpkg-compat32"; + + script (qw/ sboinstall -p nonexistentslackbuild /, { input => "y\ny\ny", expected => qr!Failures:\n nonexistentslackbuild-compat32: compat32 requires /usr/sbin/convertpkg-compat32[.]\n!, exit => 11 }); +} + +# 16: Multilib fails - convertpkg fail +SKIP: { + skip "Multilib convertpkg fail test only valid if TEST_MULTILIB=2", 1 unless $ENV{TEST_MULTILIB} == 2; + skip "No /etc/profile.d/32dev.sh", 1 unless -e "/etc/profile.d/32dev.sh"; + skip "No /usr/sbin/convertpkg-compat32", 1 unless -e "/usr/sbin/convertpkg-compat32"; + + script (qw/ sboinstall -p multilibfail /, { input => "y\ny\ny", expected => qr//, exit => 9 }); +} + # Cleanup END { set_lo('delete'); |