aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Guldstrand <andreas.guldstrand@gmail.com>2016-04-18 00:03:09 +0200
committerAndreas Guldstrand <andreas.guldstrand@gmail.com>2016-04-18 00:03:09 +0200
commit39f5a13ffb06f87c1067380afed9f117b50552f1 (patch)
treedefc9d5aa6c82e5d611356f23c12b0d5ee107740
parentf53f954f9ba98e062c79ec11fecdd4db772c0c29 (diff)
downloadsbotools2-39f5a13ffb06f87c1067380afed9f117b50552f1.tar.xz
14-jobs.t: test 0 and invalid -j values
-rwxr-xr-xt/14-jobs.t13
1 files changed, 12 insertions, 1 deletions
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 {