sbotools2

Maintenance fork of the original sbotools version 2
Log | Files | Refs | README

commit 39f5a13ffb06f87c1067380afed9f117b50552f1
parent f53f954f9ba98e062c79ec11fecdd4db772c0c29
Author: Andreas Guldstrand <andreas.guldstrand@gmail.com>
Date:   Mon, 18 Apr 2016 00:03:09 +0200

14-jobs.t: test 0 and invalid -j values

Diffstat:
Mt/14-jobs.t | 13++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/t/14-jobs.t b/t/14-jobs.t @@ -11,7 +11,7 @@ use lib "$RealBin/../SBO-Lib/lib"; use Test::Sbotools qw/ set_lo set_jobs sboinstall sboremove sboconfig /; if ($ENV{TEST_INSTALL}) { - plan tests => 4; + plan tests => 6; } else { plan skip_all => "Only run these tests if TEST_INSTALL=1"; } @@ -59,6 +59,17 @@ sboconfig(qw/ -j FALSE /, { test => 0 }); } sboremove('nonexistentslackbuild', { input => "y\ny", test => 0 }); +# 5: sboinstall -j 0 with jobs set to 2 +sboconfig(qw/ -j 2 /, { test => 0 }); +{ + my ($time) = sboinstall(qw/ -j 0 -r nonexistentslackbuild /, { expected => qr/^real\s+\d+m([\d.]+)s$/m, test => 0 }); + ok ($time > 5, "-j 0 took the expected amount of time"); +} +sboremove('nonexistentslackbuild', { input => "y\ny", test => 0 }); + +#6: sboinstall -j invalid +sboinstall(qw/ -j invalid nonexistentslackbuild /, { exit => 1, expected => "You have provided an invalid value for -j|--jobs\n" }); + # Cleanup END {