summaryrefslogtreecommitdiff
blob: a1f139cc9fedbe2a708f82a8508ecb0ef65c3ae8 (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
43
44
45
46
47
48
49
50
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-python/sancho/sancho-2.4.ebuild,v 1.8 2009/11/26 10:34:37 maekke Exp $

EAPI="2"

NEED_PYTHON="2.4"
SUPPORT_PYTHON_ABIS="1"

inherit distutils

MY_P=${P/s/S}
DESCRIPTION="Sancho is a unit testing framework"
HOMEPAGE="http://www.mems-exchange.org/software/sancho/"
SRC_URI="http://www.mems-exchange.org/software/files/${PN}/${MY_P}.tar.gz"

LICENSE="CNRI"
SLOT="0"
KEYWORDS="alpha amd64 arm hppa ~ia64 ~mips ppc ppc64 ~sparc x86"
IUSE=""

DEPEND=""
RDEPEND=""

S="${WORKDIR}/${MY_P}"

DOCS="CHANGES.txt"

src_test() {
	cd test
	testing() {
		local test test_failure test_failure_count=0
		for test in *.py; do
			test_failure="0"
			ebegin "Testing ${test}"
			PYTHONPATH="../build-${PYTHON_ABI}/lib" "$(PYTHON)" "${test}" > "${test}.output"
			grep -Eqv "^${test}: .*:$" "${test}.output" && test_failure="1"
			eend "${test_failure}"
			if [[ "${test_failure}" == "1" ]]; then
				((test_failure_count++))
				eerror "Failure output for ${test}"
				cat "${test}.output"
			fi
		done
		if [[ "${test_failure_count}" -gt "0" ]]; then
			die "${test_failure_count} tests failed with Python ${PYTHON_ABI}"
		fi
	}
	python_execute_function testing
}