- Clean up spec per merge review comments.
- Fix testsuite. - Resolves: #225679
This commit is contained in:
parent
59a9d73d53
commit
079cceaec6
93
dejagnu-1.4.4-testsuite.patch
Normal file
93
dejagnu-1.4.4-testsuite.patch
Normal file
@ -0,0 +1,93 @@
|
|||||||
|
diff -Burp dejagnu-1.4.4/testsuite/libdejagnu/unit.cc dejagnu-1.4.4-pm/testsuite/libdejagnu/unit.cc
|
||||||
|
--- dejagnu-1.4.4/testsuite/libdejagnu/unit.cc 2003-08-17 03:33:06.000000000 +0200
|
||||||
|
+++ dejagnu-1.4.4-pm/testsuite/libdejagnu/unit.cc 2007-10-03 18:31:03.000000000 +0200
|
||||||
|
@@ -7,6 +7,7 @@
|
||||||
|
#include <fstream>
|
||||||
|
#include <set>
|
||||||
|
#include <dejagnu.h>
|
||||||
|
+#include <sstream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
@@ -49,12 +50,8 @@ main (int argc, char *argv[]) {
|
||||||
|
// Replace the output buffer for cout, so we can examine it to
|
||||||
|
// see what was displayed. Otherwise, there is no way we can test
|
||||||
|
// the logging functions completely.
|
||||||
|
- char bbuuff[5120];
|
||||||
|
-#ifdef __STDC_HOSTED__
|
||||||
|
- cout.rdbuf()->pubsetbuf(bbuuff, 5120);
|
||||||
|
-#else
|
||||||
|
- cout.rdbuf()->setbuf(bbuuff, 5120);
|
||||||
|
-#endif
|
||||||
|
+ stringstream stream;
|
||||||
|
+ streambuf * buf = cout.rdbuf(stream.rdbuf());
|
||||||
|
|
||||||
|
testClass1.tname = "testType1";
|
||||||
|
testClass1.tnum = 1;
|
||||||
|
@@ -65,53 +62,59 @@ main (int argc, char *argv[]) {
|
||||||
|
|
||||||
|
// Test the pass message
|
||||||
|
test.pass ("bogus pass message for testing");
|
||||||
|
+ cout.flush();
|
||||||
|
outstate = os2;
|
||||||
|
- if (strncmp(bbuuff, "\tPAS: bogus pass message", 22) == 0) {
|
||||||
|
+ if (strncmp(stream.str().c_str(), "\tPAS: bogus pass message", 22) == 0) {
|
||||||
|
runtest.pass ("Pass message");
|
||||||
|
} else {
|
||||||
|
runtest.fail ("Pass message");
|
||||||
|
}
|
||||||
|
+ stream.str("");
|
||||||
|
|
||||||
|
// Test the fail message
|
||||||
|
outstate = os1;
|
||||||
|
test.fail ("bogus fail message for testing");
|
||||||
|
cout.flush();
|
||||||
|
outstate = os2;
|
||||||
|
- if (strncmp(bbuuff, "\tFAI: bogus fail message", 22) == 0) {
|
||||||
|
+ if (strncmp(stream.str().c_str(), "\tFAI: bogus fail message", 22) == 0) {
|
||||||
|
runtest.pass ("Fail message");
|
||||||
|
} else {
|
||||||
|
runtest.fail ("Fail message");
|
||||||
|
}
|
||||||
|
+ stream.str("");
|
||||||
|
|
||||||
|
// Test the untested message
|
||||||
|
outstate = os1;
|
||||||
|
test.untested ("bogus untested message for testing");
|
||||||
|
cout.flush();
|
||||||
|
outstate = os2;
|
||||||
|
- if (strncmp(bbuuff, "\tUNT: bogus untested message", 21) == 0) {
|
||||||
|
+ if (strncmp(stream.str().c_str(), "\tUNT: bogus untested message", 21) == 0) {
|
||||||
|
runtest.pass ("Untested message");
|
||||||
|
} else {
|
||||||
|
runtest.fail ("Untested message");
|
||||||
|
}
|
||||||
|
+ stream.str("");
|
||||||
|
|
||||||
|
// Test the unresolved message
|
||||||
|
outstate = os1;
|
||||||
|
test.unresolved ("bogus unresolved message for testing");
|
||||||
|
cout.flush();
|
||||||
|
outstate = os2;
|
||||||
|
- if (strncmp(bbuuff, "\tUNR: bogus unresolved message", 21) == 0) {
|
||||||
|
+ if (strncmp(stream.str().c_str(), "\tUNR: bogus unresolved message", 21) == 0) {
|
||||||
|
runtest.pass ("Unresolved message");
|
||||||
|
} else {
|
||||||
|
runtest.fail ("Unresolved message");
|
||||||
|
}
|
||||||
|
+ stream.str("");
|
||||||
|
|
||||||
|
// Make sure we got everything in the totals
|
||||||
|
regcomp (®ex_pat, "\r\n\t#passed.*#failed.*#untested.*#unresolved", REG_NOSUB|REG_NEWLINE);
|
||||||
|
- if (regexec (®ex_pat, bbuuff, 0, (regmatch_t *)0, 0)) {
|
||||||
|
+ if (regexec (®ex_pat, stream.str().c_str(), 0, (regmatch_t *)0, 0)) {
|
||||||
|
runtest.pass ("Totals message");
|
||||||
|
} else {
|
||||||
|
runtest.fail ("Totals message");
|
||||||
|
}
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
+ stream.str("");
|
||||||
|
|
||||||
|
+ cout.rdbuf(buf);
|
||||||
|
+}
|
26
dejagnu.spec
26
dejagnu.spec
@ -1,18 +1,19 @@
|
|||||||
Summary: A front end for testing other programs
|
Summary: A front end for testing other programs
|
||||||
Name: dejagnu
|
Name: dejagnu
|
||||||
Version: 1.4.4
|
Version: 1.4.4
|
||||||
Release: 8
|
Release: 9
|
||||||
Epoch: 1
|
Epoch: 1
|
||||||
License: GPLv2+
|
License: GPLv2+
|
||||||
Source: ftp://ftp.gnu.org/gnu/dejagnu/dejagnu-1.4.4.tar.gz
|
Source: ftp://ftp.gnu.org/gnu/dejagnu/dejagnu-%{version}.tar.gz
|
||||||
Group: Development/Tools
|
Group: Development/Tools
|
||||||
URL: http://www.gnu.org/software/dejagnu/
|
URL: http://www.gnu.org/software/dejagnu/
|
||||||
Requires: tcl >= 8.0, expect >= 5.21
|
Requires: expect
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||||
BuildArchitectures: noarch
|
BuildArch: noarch
|
||||||
BuildRequires: jadetex docbook-utils-pdf tetex-dvips
|
BuildRequires: expect
|
||||||
Patch1: dejagnu-1.4.4-smp-1.patch
|
Patch1: dejagnu-1.4.4-smp-1.patch
|
||||||
Patch2: dejagnu-1.4.4-no-info.patch
|
Patch2: dejagnu-1.4.4-no-info.patch
|
||||||
|
Patch3: dejagnu-1.4.4-testsuite.patch
|
||||||
|
|
||||||
%description
|
%description
|
||||||
DejaGnu is an Expect/Tcl based framework for testing other programs.
|
DejaGnu is an Expect/Tcl based framework for testing other programs.
|
||||||
@ -23,18 +24,17 @@ output format of all tests (making it easier to integrate the testing
|
|||||||
into software development).
|
into software development).
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n dejagnu-%{version}
|
%setup -q
|
||||||
%patch1 -p1
|
%patch1 -p1
|
||||||
%patch2 -p1
|
%patch2 -p1
|
||||||
|
%patch3 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%configure -v
|
%configure -v
|
||||||
make
|
|
||||||
mv doc/html doc/overview
|
|
||||||
|
|
||||||
%check
|
%check
|
||||||
echo ============TESTING===============
|
echo ============TESTING===============
|
||||||
make -k check RUNTESTFLAGS="RUNTEST=`pwd`/runtest" || :
|
make check RUNTESTFLAGS="RUNTEST=`pwd`/runtest"
|
||||||
echo ============END TESTING===========
|
echo ============END TESTING===========
|
||||||
|
|
||||||
%install
|
%install
|
||||||
@ -44,7 +44,7 @@ chmod a-x $RPM_BUILD_ROOT/%{_datadir}/dejagnu/runtest.exp
|
|||||||
|
|
||||||
pushd doc
|
pushd doc
|
||||||
make docs
|
make docs
|
||||||
make man1dir=%{buildroot}%{_mandir}/man1 install-man
|
make DESTDIR=$RPM_BUILD_ROOT install-man
|
||||||
popd
|
popd
|
||||||
|
|
||||||
%clean
|
%clean
|
||||||
@ -58,8 +58,12 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
%{_includedir}/dejagnu.h
|
%{_includedir}/dejagnu.h
|
||||||
%{_mandir}/*/*
|
%{_mandir}/*/*
|
||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Oct 3 2007 Petr Machata <pmachata@redhat.com> - 1:1.4.4-9
|
||||||
|
- Clean up spec per merge review comments.
|
||||||
|
- Fix testsuite.
|
||||||
|
- Resolves: #225679
|
||||||
|
|
||||||
* Thu Aug 16 2007 Petr Machata <pmachata@redhat.com> - 1:1.4.4-8
|
* Thu Aug 16 2007 Petr Machata <pmachata@redhat.com> - 1:1.4.4-8
|
||||||
- Fix licesing tag.
|
- Fix licesing tag.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user