Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH 09/15] scons-utils.eclass: tests, be more verbose on tests being performed
Date: Fri, 01 Jan 2016 16:47:14
Message-Id: 1451666481-22145-10-git-send-email-mgorny@gentoo.org
In Reply to: [gentoo-dev] [PATCH 00/15] scons-utils.eclass: EAPI 6, better docs and cleanup by "Michał Górny"
1 ---
2 eclass/tests/scons-utils.sh | 14 ++++++--------
3 1 file changed, 6 insertions(+), 8 deletions(-)
4
5 diff --git a/eclass/tests/scons-utils.sh b/eclass/tests/scons-utils.sh
6 index 5a65fbe..7387135 100755
7 --- a/eclass/tests/scons-utils.sh
8 +++ b/eclass/tests/scons-utils.sh
9 @@ -8,7 +8,9 @@ source tests-common.sh
10 inherit scons-utils
11
12 test-scons_clean_makeopts() {
13 - local sconsopts=$(scons_clean_makeopts ${1})
14 + tbegin "scons_clean_makeopts() for ${1}"
15 +
16 + local sconsopts=$(scons_clean_makeopts ${1}) ret=0
17
18 if [[ ${sconsopts} != ${2-${1}} ]]; then
19 eerror "Self-test failed:"
20 @@ -17,11 +19,11 @@ test-scons_clean_makeopts() {
21 eerror "Expected: ${2-${1}}"
22 eerror "Actual: ${sconsopts}"
23 eoutdent
24 - (( ++failed ))
25 - return 1
26 + ret=1
27 fi
28
29 - return 0
30 + tend ${ret}
31 + return ${ret}
32 }
33
34 # jobcount expected for non-specified state
35 @@ -29,8 +31,6 @@ jc=5
36 # failed test counter
37 failed=0
38
39 -tbegin "scons_clean_makeopts()"
40 -
41 # sane MAKEOPTS
42 test-scons_clean_makeopts '--jobs=14 -k'
43 test-scons_clean_makeopts '--jobs=14 -k'
44 @@ -59,6 +59,4 @@ test-scons_clean_makeopts '--jobs funnystuff -k' "--jobs=${jc} -k"
45 test-scons_clean_makeopts '--jobs -l3' "--jobs=${jc}"
46 test-scons_clean_makeopts '-j -l3' "-j ${jc}"
47
48 -tend ${failed}
49 -
50 texit
51 --
52 2.6.4