summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2012-06-07 05:00:23 +0000
committerMike Frysinger <vapier@gentoo.org>2012-06-07 05:00:23 +0000
commit2578d5810be9ac80663c60df3446650994ad061a (patch)
tree220f78abdc3cac4d38b9a1f7b55ca930bd6cc8df /eclass/tests
parentinitial multiprocessing eclass (diff)
downloadhistorical-2578d5810be9ac80663c60df3446650994ad061a.tar.gz
historical-2578d5810be9ac80663c60df3446650994ad061a.tar.bz2
historical-2578d5810be9ac80663c60df3446650994ad061a.zip
add tests for new multiprocessing eclass
Diffstat (limited to 'eclass/tests')
-rwxr-xr-xeclass/tests/multiprocessing.sh40
-rwxr-xr-xeclass/tests/multiprocessing:makeopts_jobs.sh (renamed from eclass/tests/eutils:makeopts_jobs.sh)2
2 files changed, 41 insertions, 1 deletions
diff --git a/eclass/tests/multiprocessing.sh b/eclass/tests/multiprocessing.sh
new file mode 100755
index 000000000000..bfbf30eb500b
--- /dev/null
+++ b/eclass/tests/multiprocessing.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+source tests-common.sh
+
+inherit multiprocessing
+
+tbegin "simple"
+MAKEOPTS="-j1" multijob_init
+multijob_child_init ls -d / >/dev/null || die "fail!"
+multijob_finish
+tend $?
+
+tbegin "less simple"
+multijob_init -j3
+multijob_child_init true || die "fail!"
+multijob_child_init false || die "fail!"
+multijob_child_init true || die "fail!"
+multijob_finish
+tend $(( $? == 1 ? 0 : 1 ))
+
+tbegin "less less simple"
+multijob_init -j1
+multijob_child_init true || die "fail!"
+multijob_child_init false || die "fail!"
+multijob_child_init true && die "fail!"
+multijob_finish
+tend $?
+
+tbegin "less less less simple"
+multijob_init -j10
+multijob_child_init true || die "fail!"
+multijob_finish_one || die "fail!"
+multijob_child_init false || die "fail!"
+multijob_finish_one && die "fail!"
+multijob_child_init true || die "fail!"
+multijob_finish_one || die "fail!"
+multijob_finish
+tend $?
+
+texit
diff --git a/eclass/tests/eutils:makeopts_jobs.sh b/eclass/tests/multiprocessing:makeopts_jobs.sh
index bd9f696cc91a..4641e08b5143 100755
--- a/eclass/tests/eutils:makeopts_jobs.sh
+++ b/eclass/tests/multiprocessing:makeopts_jobs.sh
@@ -2,7 +2,7 @@
source tests-common.sh
-inherit eutils
+inherit multiprocessing
test-makeopts_jobs() {
local exp=$1; shift