Gentoo Archives: gentoo-commits

From: "Michal Gorny (mgorny)" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in eclass/tests: scons-utils.sh
Date: Thu, 07 Oct 2010 20:03:02
Message-Id: 20101007191448.8AF2020054@flycatcher.gentoo.org
1 mgorny 10/10/07 19:14:48
2
3 Added: scons-utils.sh
4 Log:
5 Introducing scons-utils.eclass -- a new eclass providing functions to help using SCons buildsystem.
6
7 Revision Changes Path
8 1.1 eclass/tests/scons-utils.sh
9
10 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/scons-utils.sh?rev=1.1&view=markup
11 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/scons-utils.sh?rev=1.1&content-type=text/plain
12
13 Index: scons-utils.sh
14 ===================================================================
15 #!/bin/bash
16
17 source tests-common.sh
18
19 inherit scons-utils
20
21 test-scons_clean_makeopts() {
22 local sconsopts=$(scons_clean_makeopts ${1})
23
24 if [[ ${sconsopts} != ${2-${1}} ]]; then
25 eerror "Self-test failed:"
26 eindent
27 eerror "MAKEOPTS: ${1}"
28 eerror "Expected: ${2-${1}}"
29 eerror "Actual: ${sconsopts}"
30 eoutdent
31 (( ++failed ))
32 return 1
33 fi
34
35 return 0
36 }
37
38 # jobcount expected for non-specified state
39 jc=255
40 # failed test counter
41 failed=0
42
43 ebegin "Testing scons_clean_makeopts()"
44
45 # sane MAKEOPTS
46 test-scons_clean_makeopts '--jobs=14 -k'
47 test-scons_clean_makeopts '--jobs=14 -k'
48 test-scons_clean_makeopts '--jobs 15 -k'
49 test-scons_clean_makeopts '--jobs=16 --keep-going'
50 test-scons_clean_makeopts '-j17 --keep-going'
51 test-scons_clean_makeopts '-j 18 --keep-going'
52
53 # needing cleaning
54 test-scons_clean_makeopts '--jobs -k' "--jobs=${jc} -k"
55 test-scons_clean_makeopts '--jobs --keep-going' "--jobs=${jc} --keep-going"
56 test-scons_clean_makeopts '-kj' "-kj ${jc}"
57
58 # broken by definition (but passed as it breaks make as well)
59 test-scons_clean_makeopts '-jk'
60 test-scons_clean_makeopts '--jobs=randum'
61 test-scons_clean_makeopts '-kjrandum'
62
63 # needing stripping
64 test-scons_clean_makeopts '--load-average=25 -kj16' '-kj16'
65 test-scons_clean_makeopts '--load-average 25 -k -j17' '-k -j17'
66 test-scons_clean_makeopts '-j2 HOME=/tmp' '-j2'
67 test-scons_clean_makeopts '--jobs funnystuff -k' "--jobs=${jc} -k"
68
69 eend ${failed}