Browse Source

* acinclude.m4(DJ_AC_STL): Also use

AC_LANG_CPLUSPLUS so we build this test case with G++.
	* aclocal.m4, configure: Regenerated.
	* dejagnu.h: Don't use testout(), have each method print the array
	value directly, which is much simpler.
        * acinclude.m4(DJ_AC_STL): s/for for/for/.
        * dejagnu.h: Add conditional support for sstream.
        (testout): Likewise. Make return type `const'.
dejagnu-1.4
Rob Savoye 25 years ago
parent
commit
682f43d264
  1. 14
      ChangeLog
  2. 2
      Makefile.in
  3. 4
      acinclude.m4
  4. 4
      aclocal.m4
  5. 26
      configure
  6. 2
      configure.in
  7. 23
      dejagnu.h
  8. 2
      doc/Makefile.in
  9. 2
      example/Makefile.in
  10. 2
      testsuite/Makefile.in
  11. 2
      testsuite/libdejagnu/Makefile.in

14
ChangeLog

@ -1,3 +1,17 @@
2001-05-28 Rob Savoye <rob@peggyo.welcomehome.org>
* acinclude.m4(DJ_AC_STL): Also use
AC_LANG_CPLUSPLUS so we build this test case with G++.
* aclocal.m4, configure: Regenerated.
* dejagnu.h: Don't use testout(), have each method print the array
value directly, which is much simpler.
2001-05-27 Jeffrey Oldham <oldham@codesourcery.com>
* acinclude.m4(DJ_AC_STL): s/for for/for/.
* dejagnu.h: Add conditional support for sstream.
(testout): Likewise. Make return type `const'.
2001-05-25 Rob Savoye <rob@peggyo.welcomehome.org> 2001-05-25 Rob Savoye <rob@peggyo.welcomehome.org>
* acinclude.m4: Add DJ_AC_STL, which figures out if we're running * acinclude.m4: Add DJ_AC_STL, which figures out if we're running

2
Makefile.in

@ -62,11 +62,13 @@ CONFIG = @CONFIG@
CXX = @CXX@ CXX = @CXX@
DOCBOOK = @DOCBOOK@ DOCBOOK = @DOCBOOK@
EXEEXT = @EXEEXT@ EXEEXT = @EXEEXT@
LEX = @LEX@
MAINT = @MAINT@ MAINT = @MAINT@
MAKEINFO = @MAKEINFO@ MAKEINFO = @MAKEINFO@
PACKAGE = @PACKAGE@ PACKAGE = @PACKAGE@
TCLSH = @TCLSH@ TCLSH = @TCLSH@
VERSION = @VERSION@ VERSION = @VERSION@
YACC = @YACC@
tclsh = @tclsh@ tclsh = @tclsh@
AUTOMAKE_OPTIONS = dejagnu AUTOMAKE_OPTIONS = dejagnu

4
acinclude.m4

@ -1,6 +1,7 @@
AC_DEFUN(DJ_AC_STL, [ AC_DEFUN(DJ_AC_STL, [
AC_MSG_CHECKING(for for STL versions) AC_MSG_CHECKING(for STL versions)
AC_CACHE_VAL(ac_cv_stl,[ AC_CACHE_VAL(ac_cv_stl,[
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([#include <iostream>], [ AC_TRY_COMPILE([#include <iostream>], [
using namespace std; using namespace std;
char bbuuff[5120]; char bbuuff[5120];
@ -11,6 +12,7 @@ AC_CACHE_VAL(ac_cv_stl,[
), ),
]) ])
AC_LANG_C
if test x"${ac_cv_stl}" != x"v2" ; then if test x"${ac_cv_stl}" != x"v2" ; then
AC_MSG_RESULT(v3) AC_MSG_RESULT(v3)
AC_DEFINE(HAVE_STL3) AC_DEFINE(HAVE_STL3)

4
aclocal.m4

@ -11,8 +11,9 @@ dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
dnl PARTICULAR PURPOSE. dnl PARTICULAR PURPOSE.
AC_DEFUN(DJ_AC_STL, [ AC_DEFUN(DJ_AC_STL, [
AC_MSG_CHECKING(for for STL versions) AC_MSG_CHECKING(for STL versions)
AC_CACHE_VAL(ac_cv_stl,[ AC_CACHE_VAL(ac_cv_stl,[
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([#include <iostream>], [ AC_TRY_COMPILE([#include <iostream>], [
using namespace std; using namespace std;
char bbuuff[5120]; char bbuuff[5120];
@ -23,6 +24,7 @@ AC_CACHE_VAL(ac_cv_stl,[
), ),
]) ])
AC_LANG_C
if test x"${ac_cv_stl}" != x"v2" ; then if test x"${ac_cv_stl}" != x"v2" ; then
AC_MSG_RESULT(v3) AC_MSG_RESULT(v3)
AC_DEFINE(HAVE_STL3) AC_DEFINE(HAVE_STL3)

26
configure

@ -1784,14 +1784,21 @@ TCLSH="${ac_cv_path_tclsh}"
echo $ac_n "checking for for STL versions""... $ac_c" 1>&6 echo $ac_n "checking for STL versions""... $ac_c" 1>&6
echo "configure:1789: checking for for STL versions" >&5 echo "configure:1789: checking for STL versions" >&5
if eval "test \"`echo '$''{'ac_cv_stl'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_stl'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1795 "configure" #line 1802 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <iostream> #include <iostream>
int main() { int main() {
@ -1801,7 +1808,7 @@ int main() {
cout.rdbuf()->pubsetbuf(bbuuff, 5120); cout.rdbuf()->pubsetbuf(bbuuff, 5120);
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:1805: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then if { (eval echo configure:1812: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest* rm -rf conftest*
ac_cv_stl=v3 ac_cv_stl=v3
@ -1817,6 +1824,13 @@ rm -f conftest*,
fi fi
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross
if test x"${ac_cv_stl}" != x"v2" ; then if test x"${ac_cv_stl}" != x"v2" ; then
echo "$ac_t""v3" 1>&6 echo "$ac_t""v3" 1>&6
cat >> confdefs.h <<\EOF cat >> confdefs.h <<\EOF
@ -1950,7 +1964,7 @@ ac_given_srcdir=$srcdir
ac_given_INSTALL="$INSTALL" ac_given_INSTALL="$INSTALL"
trap 'rm -fr `echo "Makefile doc/Makefile testsuite/Makefile example/Makefile trap 'rm -fr `echo "Makefile doc/Makefile testsuite/Makefile example/Makefile
testsuite/libdejagnu/Makefile unitparse/Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 testsuite/libdejagnu/Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
EOF EOF
cat >> $CONFIG_STATUS <<EOF cat >> $CONFIG_STATUS <<EOF
@ -2052,7 +2066,7 @@ EOF
cat >> $CONFIG_STATUS <<EOF cat >> $CONFIG_STATUS <<EOF
CONFIG_FILES=\${CONFIG_FILES-"Makefile doc/Makefile testsuite/Makefile example/Makefile CONFIG_FILES=\${CONFIG_FILES-"Makefile doc/Makefile testsuite/Makefile example/Makefile
testsuite/libdejagnu/Makefile unitparse/Makefile"} testsuite/libdejagnu/Makefile"}
EOF EOF
cat >> $CONFIG_STATUS <<\EOF cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then

2
configure.in

@ -34,5 +34,5 @@ AC_SUBST(CONFIG)
AC_CONFIG_SUBDIRS(example/calc) AC_CONFIG_SUBDIRS(example/calc)
AC_OUTPUT(Makefile doc/Makefile testsuite/Makefile example/Makefile AC_OUTPUT(Makefile doc/Makefile testsuite/Makefile example/Makefile
testsuite/libdejagnu/Makefile unitparse/Makefile) testsuite/libdejagnu/Makefile)

23
dejagnu.h

@ -68,7 +68,11 @@ totals (void) {
#include <iomanip> #include <iomanip>
#include <fstream> #include <fstream>
#include <string> #include <string>
#if HAVE_STL3
#include <sstream>
#else
#include <strstream> #include <strstream>
#endif
char *outstate[] = { char *outstate[] = {
"FAILED: ", "FAILED: ",
@ -110,16 +114,6 @@ OMANIP<int> testout(int i) {
} }
#endif #endif
char *testout (int x) {
using namespace std;
const int len = 128;
static char buf[len];
static ostrstream oss(buf, len, ios::out);
oss.seekp(ios::beg);
oss << outstate[x] << ends;
return buf;
}
enum teststate {FAILED, PASSED,UNTESTED,UNRESOLVED} laststate; enum teststate {FAILED, PASSED,UNTESTED,UNRESOLVED} laststate;
class TestState { class TestState {
@ -137,7 +131,6 @@ class TestState {
totals(); totals();
}; };
void testrun (bool b, std::string s) { void testrun (bool b, std::string s) {
if (b) if (b)
pass (s); pass (s);
@ -149,7 +142,7 @@ class TestState {
passed++; passed++;
laststate = PASSED; laststate = PASSED;
lastmsg = s; lastmsg = s;
std::cout << "\t" << testout(PASSED) << s << std::endl; std::cout << "\t" << outstate[PASSED] << s << std::endl;
} }
void pass (const char *c) { void pass (const char *c) {
std::string s = c; std::string s = c;
@ -160,7 +153,7 @@ class TestState {
failed++; failed++;
laststate = FAILED; laststate = FAILED;
lastmsg = s; lastmsg = s;
std::cout << "\t" << testout(FAILED) << s << std::endl; std::cout << "\t" << outstate[FAILED] << s << std::endl;
} }
void fail (const char *c) { void fail (const char *c) {
std::string s = c; std::string s = c;
@ -171,7 +164,7 @@ class TestState {
untest++; untest++;
laststate = UNTESTED; laststate = UNTESTED;
lastmsg = s; lastmsg = s;
std::cout << "\t" << testout(UNTESTED) << s << std::endl; std::cout << "\t" << outstate[UNTESTED] << s << std::endl;
} }
void untested (const char *c) { void untested (const char *c) {
std::string s = c; std::string s = c;
@ -182,7 +175,7 @@ class TestState {
unresolve++; unresolve++;
laststate = UNRESOLVED; laststate = UNRESOLVED;
lastmsg = s; lastmsg = s;
std::cout << "\t" << testout(UNRESOLVED) << s << std::endl; std::cout << "\t" << outstate[UNRESOLVED] << s << std::endl;
} }
void unresolved (const char *c) { void unresolved (const char *c) {
std::string s = c; std::string s = c;

2
doc/Makefile.in

@ -64,11 +64,13 @@ CC = @CC@
CONFIG = @CONFIG@ CONFIG = @CONFIG@
CXX = @CXX@ CXX = @CXX@
EXEEXT = @EXEEXT@ EXEEXT = @EXEEXT@
LEX = @LEX@
MAINT = @MAINT@ MAINT = @MAINT@
MAKEINFO = @MAKEINFO@ MAKEINFO = @MAKEINFO@
PACKAGE = @PACKAGE@ PACKAGE = @PACKAGE@
TCLSH = @TCLSH@ TCLSH = @TCLSH@
VERSION = @VERSION@ VERSION = @VERSION@
YACC = @YACC@
tclsh = @tclsh@ tclsh = @tclsh@
man_MANS = runtest.1 man_MANS = runtest.1

2
example/Makefile.in

@ -63,11 +63,13 @@ CONFIG = @CONFIG@
CXX = @CXX@ CXX = @CXX@
DOCBOOK = @DOCBOOK@ DOCBOOK = @DOCBOOK@
EXEEXT = @EXEEXT@ EXEEXT = @EXEEXT@
LEX = @LEX@
MAINT = @MAINT@ MAINT = @MAINT@
MAKEINFO = @MAKEINFO@ MAKEINFO = @MAKEINFO@
PACKAGE = @PACKAGE@ PACKAGE = @PACKAGE@
TCLSH = @TCLSH@ TCLSH = @TCLSH@
VERSION = @VERSION@ VERSION = @VERSION@
YACC = @YACC@
tclsh = @tclsh@ tclsh = @tclsh@
AUTOMAKE_OPTIONS = dejagnu AUTOMAKE_OPTIONS = dejagnu

2
testsuite/Makefile.in

@ -63,11 +63,13 @@ CONFIG = @CONFIG@
CXX = @CXX@ CXX = @CXX@
DOCBOOK = @DOCBOOK@ DOCBOOK = @DOCBOOK@
EXEEXT = @EXEEXT@ EXEEXT = @EXEEXT@
LEX = @LEX@
MAINT = @MAINT@ MAINT = @MAINT@
MAKEINFO = @MAKEINFO@ MAKEINFO = @MAKEINFO@
PACKAGE = @PACKAGE@ PACKAGE = @PACKAGE@
TCLSH = @TCLSH@ TCLSH = @TCLSH@
VERSION = @VERSION@ VERSION = @VERSION@
YACC = @YACC@
tclsh = @tclsh@ tclsh = @tclsh@
AUTOMAKE_OPTIONS = dejagnu AUTOMAKE_OPTIONS = dejagnu

2
testsuite/libdejagnu/Makefile.in

@ -65,11 +65,13 @@ CONFIG = @CONFIG@
CXX = @CXX@ CXX = @CXX@
DOCBOOK = @DOCBOOK@ DOCBOOK = @DOCBOOK@
EXEEXT = @EXEEXT@ EXEEXT = @EXEEXT@
LEX = @LEX@
MAINT = @MAINT@ MAINT = @MAINT@
MAKEINFO = @MAKEINFO@ MAKEINFO = @MAKEINFO@
PACKAGE = @PACKAGE@ PACKAGE = @PACKAGE@
TCLSH = @TCLSH@ TCLSH = @TCLSH@
VERSION = @VERSION@ VERSION = @VERSION@
YACC = @YACC@
tclsh = @tclsh@ tclsh = @tclsh@
CFLAGS = -I$(top_srcdir) -g CFLAGS = -I$(top_srcdir) -g

Loading…
Cancel
Save