summaryrefslogtreecommitdiff
blob: 1ceb7f7fa7b27e522db97dd8dd7faaf3bd87e249 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

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