Author: ablack
Date: Tue Mar 6 14:38:21 2007
New Revision: 515332
URL: http://svn.apache.org/viewvc?view=rev&rev=515332
Log:
2007-03-05 Andrew Black <[EMAIL PROTECTED]>
* tests/src/driver.cpp (_rw_setopt_output_file): Add logic to treat
the magic file name of '-' as a reference to stdout.
* etc/config/GNUmakefile.tst (RUNFLAGS): Specify compatibility mode
flags to enable parsing of legacy tests.
* util/output.cpp (check_compat_test): Adjust seek position to avoid
false format errors when an executable contains a very small number
of tests.
Modified:
incubator/stdcxx/trunk/etc/config/GNUmakefile.tst
incubator/stdcxx/trunk/tests/src/driver.cpp
incubator/stdcxx/trunk/util/output.cpp
Modified: incubator/stdcxx/trunk/etc/config/GNUmakefile.tst
URL:
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/etc/config/GNUmakefile.tst?view=diff&rev=515332&r1=515331&r2=515332
==============================================================================
--- incubator/stdcxx/trunk/etc/config/GNUmakefile.tst (original)
+++ incubator/stdcxx/trunk/etc/config/GNUmakefile.tst Tue Mar 6 14:38:21 2007
@@ -71,6 +71,8 @@
LDFLAGS += $(RPATH)$(LIBDIR):$(BUILDDIR)/rwtest
endif
+RUNFLAGS = --compat -x "--compat -O -"
+
##############################################################################
# TARGETS
##############################################################################
Modified: incubator/stdcxx/trunk/tests/src/driver.cpp
URL:
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/src/driver.cpp?view=diff&rev=515332&r1=515331&r2=515332
==============================================================================
--- incubator/stdcxx/trunk/tests/src/driver.cpp (original)
+++ incubator/stdcxx/trunk/tests/src/driver.cpp Tue Mar 6 14:38:21 2007
@@ -609,15 +609,18 @@
}
if (file_name) {
+ if (file_name[0] != '-' || file_name[1] != '\0') {
+ FILE* const f = fopen (file_name, "w");
- FILE* const f = fopen (file_name, "w");
+ if (f) {
+ if (_rw_ftestout && _rw_ftestout != rw_stdout)
+ fclose ((FILE*)(void*)_rw_ftestout);
- if (f) {
- if (_rw_ftestout && _rw_ftestout != rw_stdout)
- fclose ((FILE*)(void*)_rw_ftestout);
-
- _rw_ftestout = (rw_file*)(void*)f;
+ _rw_ftestout = (rw_file*)(void*)f;
+ }
}
+ else
+ _rw_ftestout = (rw_file*)(void*)stdout;
}
// return 0 on success, any non-zero value on failure
Modified: incubator/stdcxx/trunk/util/output.cpp
URL:
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/util/output.cpp?view=diff&rev=515332&r1=515331&r2=515332
==============================================================================
--- incubator/stdcxx/trunk/util/output.cpp (original)
+++ incubator/stdcxx/trunk/util/output.cpp Tue Mar 6 14:38:21 2007
@@ -145,7 +145,7 @@
assert (0 != data);
assert (0 != status);
- fseek (data, -80, SEEK_END); /* Seek near the end of the file */
+ fseek (data, -70, SEEK_END); /* Seek near the end of the file */
for (tok = fgetc (data); fsm < 4 && !feof (data); tok = fgetc (data)) {
switch (tok) {