Invent ugly, convoluted way to run dejagnu testsuite in mock (where there

is no terminal).
This commit is contained in:
Petr Machata 2007-10-03 21:47:51 +00:00
parent 079cceaec6
commit 31b394f044

View File

@ -10,7 +10,7 @@ URL: http://www.gnu.org/software/dejagnu/
Requires: expect
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: expect
BuildRequires: expect screen
Patch1: dejagnu-1.4.4-smp-1.patch
Patch2: dejagnu-1.4.4-no-info.patch
Patch3: dejagnu-1.4.4-testsuite.patch
@ -34,8 +34,17 @@ into software development).
%check
echo ============TESTING===============
make check RUNTESTFLAGS="RUNTEST=`pwd`/runtest"
# Dejagnu needs to report to user occasionally, and it needs a
# terminal for that. That doesn't compute in mock. Work around it by
# running the test under screen and communicating back to test runner
# via temporary file. If you come with better method, please do tell.
TMP=`mktemp` || exit 1
screen -D -m sh -c '(make check RUNTESTFLAGS="RUNTEST=`pwd`/runtest"; echo $?) >> '$TMP
RESULT=`tail -n 1 $TMP`
[ $RESULT != 0 ] && cat $TMP
rm -f $TMP
echo ============END TESTING===========
exit $RESULT
%install
rm -rf $RPM_BUILD_ROOT