summaryrefslogtreecommitdiffstats
path: root/testsuites
diff options
context:
space:
mode:
authorRalf Corsepius <ralf.corsepius@rtems.org>2004-05-10 16:02:11 +0000
committerRalf Corsepius <ralf.corsepius@rtems.org>2004-05-10 16:02:11 +0000
commit51ca358ac75271c6ddd10cc0fd2460ba88a45015 (patch)
tree18a995a3fd2833223c849c39e6e0af8b066dcda5 /testsuites
parente12ba0e4f07e5fda4219541ea7afdf6aa4833238 (diff)
downloadrtems-51ca358ac75271c6ddd10cc0fd2460ba88a45015.tar.bz2
2004-05-10 Ralf Corsepius <ralf_corsepius@rtems.org>
* configure.ac: Add CXX-checks. New conditionals CXXTESTS, MPTESTS, NETTESTS. Add iostream/. * Makefile.am, base_mp/node1/Makefile.am, base_mp/node2/Makefile.am cdtest/Makefile.am, loopback/Makefile.am, pppd/Makefile.am: Reflect changes above. * cdtest/main.cc: Adaptation to new C++ standards.
Diffstat (limited to '')
-rw-r--r--testsuites/samples/ChangeLog9
-rw-r--r--testsuites/samples/Makefile.am26
-rw-r--r--testsuites/samples/base_mp/node1/Makefile.am5
-rw-r--r--testsuites/samples/base_mp/node2/Makefile.am5
-rw-r--r--testsuites/samples/cdtest/Makefile.am6
-rw-r--r--testsuites/samples/cdtest/main.cc10
-rw-r--r--testsuites/samples/configure.ac32
-rw-r--r--testsuites/samples/loopback/Makefile.am2
-rw-r--r--testsuites/samples/pppd/Makefile.am2
9 files changed, 60 insertions, 37 deletions
diff --git a/testsuites/samples/ChangeLog b/testsuites/samples/ChangeLog
index da36b1104b..cd24f1e39c 100644
--- a/testsuites/samples/ChangeLog
+++ b/testsuites/samples/ChangeLog
@@ -1,5 +1,14 @@
2004-05-10 Ralf Corsepius <ralf_corsepius@rtems.org>
+ * configure.ac: Add CXX-checks. New conditionals CXXTESTS, MPTESTS,
+ NETTESTS. Add iostream/.
+ * Makefile.am, base_mp/node1/Makefile.am, base_mp/node2/Makefile.am
+ cdtest/Makefile.am, loopback/Makefile.am, pppd/Makefile.am:
+ Reflect changes above.
+ * cdtest/main.cc: Adaptation to new C++ standards.
+
+2004-05-10 Ralf Corsepius <ralf_corsepius@rtems.org>
+
* iostream/Makefile.am, iostream/init.cc, iostream/iostream.doc,
iostream/iostream.scn, iostream/system.h:
New (C++ variant of hello).
diff --git a/testsuites/samples/Makefile.am b/testsuites/samples/Makefile.am
index 07088554ef..fd763cb2a2 100644
--- a/testsuites/samples/Makefile.am
+++ b/testsuites/samples/Makefile.am
@@ -4,23 +4,27 @@
ACLOCAL_AMFLAGS = -I ../aclocal
-CPLUSPLUS_TESTS = cdtest
+SUBDIRS = hello ticker base_sp unlimited minimum fileio
+if MPTESTS
## base_mp is a sample multiprocessing test
-MP_TESTS = base_mp
+SUBDIRS += base_mp
+endif
-FP_TESTS = paranoia
+SUBDIRS += paranoia
-## loopback tests a network loopback interface
-NET_TESTS = loopback
-NET_TESTS += pppd
-
-SUBDIRS = hello ticker base_sp unlimited minimum fileio $(MP_TESTS) \
- $(CPLUSPLUS_TESTS) $(FP_TESTS) $(NET_TESTS)
+if CXXTESTS
+SUBDIRS += iostream cdtest
+endif
-AUTOMAKE_FILES = sample.am
+if NETTESTS
+## loopback tests a network loopback interface
+SUBDIRS += loopback
+SUBDIRS += pppd
+endif
-EXTRA_DIST = $(AUTOMAKE_FILES)
+DIST_SUBDIRS = hello ticker base_sp unlimited minimum fileio base_mp cdtest \
+ paranoia loopback pppd
include $(top_srcdir)/../automake/subdirs.am
include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/samples/base_mp/node1/Makefile.am b/testsuites/samples/base_mp/node1/Makefile.am
index 7fcf942555..cd8a04dcdc 100644
--- a/testsuites/samples/base_mp/node1/Makefile.am
+++ b/testsuites/samples/base_mp/node1/Makefile.am
@@ -31,8 +31,6 @@ include $(top_srcdir)/sample.am
AM_CPPFLAGS += -DNODE_NUMBER=$(NODE) -I.
-if HAS_MP
-
#
# (OPTIONAL) Add local stuff here using +=
#
@@ -41,9 +39,6 @@ ${PGM}: $(OBJS) $(LINK_FILES)
$(make-exe)
all-local: $(TMPINSTALL_FILES)
-else
-all-local:
-endif
EXTRA_DIST = $(DOCS)
diff --git a/testsuites/samples/base_mp/node2/Makefile.am b/testsuites/samples/base_mp/node2/Makefile.am
index fb8ce41ac7..c0435ad2b1 100644
--- a/testsuites/samples/base_mp/node2/Makefile.am
+++ b/testsuites/samples/base_mp/node2/Makefile.am
@@ -31,8 +31,6 @@ include $(top_srcdir)/sample.am
AM_CPPFLAGS += -DNODE_NUMBER=$(NODE) -I.
-if HAS_MP
-
#
# (OPTIONAL) Add local stuff here using +=
#
@@ -41,9 +39,6 @@ ${PGM}: $(OBJS) $(LINK_FILES)
$(make-exe)
all-local: $(TMPINSTALL_FILES)
-else
-all-local:
-endif
EXTRA_DIST = $(DOCS)
diff --git a/testsuites/samples/cdtest/Makefile.am b/testsuites/samples/cdtest/Makefile.am
index fec4459bf8..30c597c720 100644
--- a/testsuites/samples/cdtest/Makefile.am
+++ b/testsuites/samples/cdtest/Makefile.am
@@ -29,18 +29,16 @@ include $(top_srcdir)/../automake/compile.am
include $(top_srcdir)/../automake/leaf.am
include $(top_srcdir)/sample.am
+# AM_CPPFLAGS += -DRTEMS_TEST_IO_STREAM
+
#
# (OPTIONAL) Add local stuff here using +=
#
-if HAS_CXX
${PGM}: $(OBJS) $(LINK_FILES)
$(make-cxx-exe)
all-local: $(TMPINSTALL_FILES)
-else
-all-local:
-endif
EXTRA_DIST = $(C_FILES) $(CC_FILES) $(DOCS)
diff --git a/testsuites/samples/cdtest/main.cc b/testsuites/samples/cdtest/main.cc
index 25dd0e2a63..1705c214db 100644
--- a/testsuites/samples/cdtest/main.cc
+++ b/testsuites/samples/cdtest/main.cc
@@ -26,10 +26,12 @@
*/
#include <rtems.h>
-#include <stdio.h>
-#include <stdlib.h>
+
+#include <cstdio>
+#include <cstdlib>
+
#ifdef RTEMS_TEST_IO_STREAM
-#include <iostream.h>
+#include <iostream>
#endif
extern "C"
@@ -144,7 +146,7 @@ cdtest(void)
BClass bleak;
#ifdef RTEMS_TEST_IO_STREAM
- cout << "Testing a C++ I/O stream" << endl;
+ std::cout << "Testing a C++ I/O stream" << std::endl;
#else
printf("IO Stream not tested\n");
#endif
diff --git a/testsuites/samples/configure.ac b/testsuites/samples/configure.ac
index ef1a0b059e..862b37a6c9 100644
--- a/testsuites/samples/configure.ac
+++ b/testsuites/samples/configure.ac
@@ -23,7 +23,6 @@ RTEMS_PROJECT_ROOT
RTEMS_PROG_CC_FOR_TARGET
RTEMS_PROG_CXX_FOR_TARGET
-
RTEMS_CANONICALIZE_TOOLS
RTEMS_CHECK_CUSTOM_BSP(RTEMS_BSP)
@@ -31,9 +30,33 @@ RTEMS_CHECK_MULTIPROCESSING(RTEMS_BSP)
RTEMS_CHECK_CXX(RTEMS_BSP)
RTEMS_CHECK_NETWORKING
-AM_CONDITIONAL(HAS_NETWORKING,test "$HAS_NETWORKING" = "yes")
-AM_CONDITIONAL(HAS_CXX,test "$HAS_CPLUSPLUS" = "yes")
-AM_CONDITIONAL(HAS_MP,test "$HAS_MP" = "yes")
+
+CXXTESTS=$HAS_CPLUSPLUS
+AS_IF([test $HAS_CPLUSPLUS = yes],[
+ AC_LANG_PUSH([C++])
+ AC_CHECK_HEADERS([cstdio cstdlib iostream],[],[CXXTESTS=no])
+ AC_CACHE_CHECK(
+ [if iostream supports std:: namespace],
+ [rtems_cv_HAVE_IOSTREAM_STD_NAMESPACE],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <iostream>]],
+ [[std::cout << "hello" << std::endl;]])
+ ],
+ [rtems_cv_HAVE_IOSTREAM_STD_NAMESPACE=yes],
+ [rtems_cv_HAVE_IOSTREAM_STD_NAMESPACE=no])
+ ])
+ AS_IF([test $rtems_cv_HAVE_IOSTREAM_STD_NAMESPACE = no],[CXXTESTS=no])
+ AS_IF([test $CXXTESTS = no],[
+ AC_MSG_WARN([disabling C++ tests])
+ ])
+ AC_LANG_POP
+])
+
+AM_CONDITIONAL([CXXTESTS],[test $CXXTESTS = "yes"])
+AM_CONDITIONAL(NETTESTS,test "$HAS_NETWORKING" = "yes")
+AM_CONDITIONAL(MPTESTS,test "$HAS_MP" = "yes")
+
#FIXME: We should use a feature based check
AM_CONDITIONAL(LIBCHIP,[test "$RTEMS_BSP_FAMILY" != "posix"])
@@ -50,6 +73,7 @@ unlimited/Makefile
base_mp/Makefile
base_mp/node1/Makefile
base_mp/node2/Makefile
+iostream/Makefile
cdtest/Makefile
pppd/Makefile
])
diff --git a/testsuites/samples/loopback/Makefile.am b/testsuites/samples/loopback/Makefile.am
index d2864b704d..59459b20aa 100644
--- a/testsuites/samples/loopback/Makefile.am
+++ b/testsuites/samples/loopback/Makefile.am
@@ -27,12 +27,10 @@ include $(top_srcdir)/sample.am
# (OPTIONAL) Add local stuff here using +=
#
-if HAS_NETWORKING
all-local: $(TMPINSTALL_FILES)
${PGM}: $(OBJS) $(LINK_FILES)
$(make-exe)
-endif
EXTRA_DIST = $(C_FILES) $(DOCS)
diff --git a/testsuites/samples/pppd/Makefile.am b/testsuites/samples/pppd/Makefile.am
index b4b7f1d2ed..5263c395de 100644
--- a/testsuites/samples/pppd/Makefile.am
+++ b/testsuites/samples/pppd/Makefile.am
@@ -26,12 +26,10 @@ include $(top_srcdir)/sample.am
# (OPTIONAL) Add local stuff here using +=
#
-if HAS_NETWORKING
all-local: $(TMPINSTALL_FILES)
${PGM}: $(OBJS) $(LINK_FILES)
$(make-exe)
-endif
EXTRA_DIST = $(C_FILES) $(H_FILES)