test using Expat from C++
(closes SF bug #1006708)
diff --git a/expat/Makefile.in b/expat/Makefile.in
index 3452644..8d1847f 100644
--- a/expat/Makefile.in
+++ b/expat/Makefile.in
@@ -58,7 +58,8 @@
cd lib && rm -f $(LIBRARY) *.o *.lo && rm -rf .libs _libs
cd xmlwf && rm -f xmlwf *.o *.lo && rm -rf .libs _libs
cd examples && rm -f elements outline *.o *.lo && rm -rf .libs _libs
- cd tests && rm -rf .libs runtests runtests.o chardata.o
+ cd tests && rm -rf .libs runtests runtests.o runtestspp runtestspp.o
+ cd tests && rm -f chardata.o minicheck.o
rm -rf .libs libexpat.la
rm -f examples/core tests/core xmlwf/core
@@ -72,8 +73,9 @@
rm -f expat_config.h.in configure
rm -f conftools/ltconfig conftools/ltmain.sh conftools/libtool.m4
-check: tests/runtests
+check: tests/runtests tests/runtestspp
tests/runtests
+ tests/runtestspp
install: xmlwf/xmlwf installlib
$(mkinstalldirs) $(INSTALL_ROOT)$(bindir) $(INSTALL_ROOT)$(man1dir)
@@ -112,9 +114,11 @@
LTFLAGS = --silent
COMPILE = $(CC) $(INCLUDES) $(CFLAGS) $(DEFS) $(CPPFLAGS)
+CXXCOMPILE = $(CXX) $(INCLUDES) $(CFLAGS) $(DEFS) $(CPPFLAGS)
LTCOMPILE = $(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE)
LINK_LIB = $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) -no-undefined $(VSNFLAG) -rpath $(libdir) $(LDFLAGS) -o $@
LINK_EXE = $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) $(LDFLAGS) -o $@
+LINK_CXX_EXE = $(LIBTOOL) $(LTFLAGS) --mode=link $(CXXCOMPILE) $(LDFLAGS) -o $@
LIB_OBJS = lib/xmlparse.lo lib/xmltok.lo lib/xmlrole.lo
$(LIBRARY): $(LIB_OBJS)
@@ -153,6 +157,9 @@
tests/runtests.o: tests/runtests.c tests/chardata.h
tests/runtests: tests/runtests.o tests/chardata.o tests/minicheck.o $(LIBRARY)
$(LINK_EXE) $^
+tests/runtestspp.o: tests/runtestspp.cpp tests/chardata.h
+tests/runtestspp: tests/runtestspp.o tests/chardata.o tests/minicheck.o $(LIBRARY)
+ $(LINK_CXX_EXE) $^
tests/xmlts.zip:
wget --output-document=tests/xmlts.zip \
diff --git a/expat/tests/.gitignore b/expat/tests/.gitignore
index 4542fcf..7cec7b5 100644
--- a/expat/tests/.gitignore
+++ b/expat/tests/.gitignore
@@ -1,5 +1,6 @@
Makefile
runtests
+runtestspp
xmlts.zip
XML-Test-Suite
.libs
diff --git a/expat/tests/runtestspp.cpp b/expat/tests/runtestspp.cpp
new file mode 100644
index 0000000..c35dc58
--- /dev/null
+++ b/expat/tests/runtestspp.cpp
@@ -0,0 +1,6 @@
+// C++ compilation harness for the test suite.
+//
+// This is used to ensure the Expat headers can be included from C++
+// and have everything work as expected.
+//
+#include "runtests.c"