summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2012-05-11 14:22:01 +0000
committerMike Frysinger <vapier@gentoo.org>2012-05-11 14:22:01 +0000
commitd97797f4878b3c10a19228c91123abbde4b27fbe (patch)
tree141cecf681c844b9d794a3049f069359aadfa819 /eclass/tests
parentRevert homepage (it is back to original now) (diff)
downloadgentoo-2-d97797f4878b3c10a19228c91123abbde4b27fbe.tar.gz
gentoo-2-d97797f4878b3c10a19228c91123abbde4b27fbe.tar.bz2
gentoo-2-d97797f4878b3c10a19228c91123abbde4b27fbe.zip
support extended makeflag syntax and not just -j#
Diffstat (limited to 'eclass/tests')
-rwxr-xr-xeclass/tests/eutils:makeopts_jobs.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/eclass/tests/eutils:makeopts_jobs.sh b/eclass/tests/eutils:makeopts_jobs.sh
new file mode 100755
index 000000000000..bd9f696cc91a
--- /dev/null
+++ b/eclass/tests/eutils:makeopts_jobs.sh
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+source tests-common.sh
+
+inherit eutils
+
+test-makeopts_jobs() {
+ local exp=$1; shift
+ tbegin "makeopts_jobs($*) == ${exp}"
+ local act=$(makeopts_jobs "$@")
+ [[ ${act} == "${exp}" ]]
+ tend $? "Got back: ${act}"
+}
+
+tests=(
+ 999 "-j"
+ 999 "--jobs"
+ 1 ""
+ 1 "-l9 -w"
+ 1 "-l9 -w-j4"
+ 1 "-l9--jobs=3"
+ 1 "-l9--jobs=8"
+ 2 "-j2"
+ 3 "-j 3"
+ 4 "-l3 -j 4 -w"
+ 5 "--jobs=5"
+ 6 "--jobs 6"
+ 7 "-l3 --jobs 7 -w"
+ 4 "-j1 -j 2 --jobs 3 --jobs=4"
+ 8 " -j 8 "
+)
+for (( i = 0; i < ${#tests[@]}; i += 2 )) ; do
+ test-makeopts_jobs "${tests[i]}" "${tests[i+1]}"
+done
+
+texit