From 39f5a13ffb06f87c1067380afed9f117b50552f1 Mon Sep 17 00:00:00 2001 From: Andreas Guldstrand Date: Mon, 18 Apr 2016 00:03:09 +0200 Subject: 14-jobs.t: test 0 and invalid -j values --- t/14-jobs.t | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 't') diff --git a/t/14-jobs.t b/t/14-jobs.t index 1e28d09..52d8be7 100755 --- 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 { -- cgit v1.2.3