blob: b38b3675d54e5110c0437d5d63c34ab38f99793e (
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
51
|
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-python/sancho/sancho-2.1-r1.ebuild,v 1.3 2006/04/01 19:04:53 agriffis Exp $
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="~amd64 ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
IUSE=""
DEPEND=">=dev-lang/python-2.3"
S=${WORKDIR}/${MY_P}
src_install() {
mydoc="CHANGES.txt README.txt"
distutils_src_install
}
src_test() {
einfo "Setting up test env."
mkdir "${T}/tests"
"${python}" setup.py install --home="${T}/tests" "$@" \
|| die "Failed to install tests"
pushd "${T}/tests"
einfo "Running"
failcount=0
for tst in ${S}/test/*.py ; do
b="$(basename ${tst})"
o=${T}/tests/output-${b}
ebegin "Testing ${b}"
PYTHONPATH=lib/python "${python}" ${tst} >>${o}
egrep -qv "^.*/${b}: .*:\$" ${o}
rcv=$?
eend $rc
if [ $rcv -eq 0 ]; then
let failcount=${failcount}+1
eerror "Failure output for ${b}"
cat ${o}
fi
done;
[ $failcount -gt 0 ] && die "${failcount} tests failed"
einfo "Cleaning up test env."
popd
#rm -rf "${T}/tests"
}
|