summaryrefslogtreecommitdiff
blob: a1e43c8b91d7026ff7801ebe50f30a906aecf98d (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
# $Id$

source tests-common.sh

inherit multiprocessing

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     "
	999 "-kj"
	4 "-kj4"
	5 "-kj 5"
)
for (( i = 0; i < ${#tests[@]}; i += 2 )) ; do
	test-makeopts_jobs "${tests[i]}" "${tests[i+1]}"
done

texit