From 31b394f044351934db03c90cb6073f3e9c44777d Mon Sep 17 00:00:00 2001 From: Petr Machata Date: Wed, 3 Oct 2007 21:47:51 +0000 Subject: [PATCH] Invent ugly, convoluted way to run dejagnu testsuite in mock (where there is no terminal). --- dejagnu.spec | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/dejagnu.spec b/dejagnu.spec index 39eed5a..4925956 100644 --- a/dejagnu.spec +++ b/dejagnu.spec @@ -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