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: distutils-r1.sh
Date: Sun, 25 Nov 2012 08:11:04
Message-Id: 20121125081052.6C4E620C65@flycatcher.gentoo.org
1 mgorny 12/11/25 08:10:52
2
3 Added: distutils-r1.sh
4 Log:
5 Add a simple test to make sure that functions do not collide with sub-phase names (python_compile).
6
7 Revision Changes Path
8 1.1 eclass/tests/distutils-r1.sh
9
10 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/distutils-r1.sh?rev=1.1&view=markup
11 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/distutils-r1.sh?rev=1.1&content-type=text/plain
12
13 Index: distutils-r1.sh
14 ===================================================================
15 #!/bin/bash
16
17 EAPI=4
18 PYTHON_COMPAT=( python2_7 )
19 source tests-common.sh
20
21 test-phase_name_free() {
22 local ph=${1}
23
24 if declare -f "${ph}"; then
25 die "${ph} function declared while name reserved for phase!"
26 fi
27 if declare -f "${ph}_all"; then
28 die "${ph}_all function declared while name reserved for phase!"
29 fi
30 }
31
32 inherit distutils-r1
33
34 tbegin "sane function names"
35
36 test-phase_name_free python_prepare
37 test-phase_name_free python_configure
38 test-phase_name_free python_compile
39 test-phase_name_free python_test
40 test-phase_name_free python_install
41
42 tend ${failed}
43
44 texit