summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorHans Ulrich Niedermann <gp@n-dimensional.de>2006-12-29 11:01:45 +0000
committerHans Ulrich Niedermann <gp@n-dimensional.de>2006-12-29 11:01:45 +0000
commite64144813f9282065dfbcc715ce91241febfbc57 (patch)
tree90e40e465c0057545d0e6bc1182479fc69a26e8f /tests
parent3d5d0926292b8ff82dfcdc9459f4107b51857cb8 (diff)
downloadlibgphoto2-e64144813f9282065dfbcc715ce91241febfbc57.tar.gz
make sure that the pedantic compilation tests work
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@9768 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am18
-rw-r--r--tests/test-pedantic-compilation.c5
-rw-r--r--tests/test-pedantic-compilation.cxx5
3 files changed, 22 insertions, 6 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 8ea93c4d7..20da5eaa8 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -14,8 +14,10 @@ check_SCRIPTS = \
EXTRA_DIST = \
check-camera-list.sh.in
-# TESTS = $(check_SCRIPTS)
+TESTS = test-pedantic-c test-pedantic-cxx
+# These tests must run after installation because they need the
+# camlibs installed.
INSTALL_TESTS = check-camera-list.sh
CLEANFILES = $(check_SCRIPTS)
@@ -47,7 +49,7 @@ test_camera_list_LDADD = \
if HAVE_GCC
PEDANTIC_CFLAGS = -std=c99 -pedantic-errors -W -Wall -Wextra -Werror
-PEDANTIC_CXXFLAGS = -ansi -pedantic-errors -W -Wall -Wextra -Werror
+PEDANTIC_CXXFLAGS = -std=c++98 -pedantic-errors -W -Wall -Wextra -Werror
else
PEDANTIC_CFLAGS =
PEDANTIC_CXXFLAGS =
@@ -56,8 +58,10 @@ endif
test_pedantic_c_SOURCES = test-pedantic-compilation.c
test_pedantic_c_CPPFLAGS = \
$(AM_CPPFLAGS) $(CPPFLAGS) \
- -U _GPHOTO2_INTERNAL_CODE
-test_pedantic_c_CFLAGS = $(PEDANTIC_CFLAGS) $(AM_CFLAGS) $(CFLAGS)
+ -U_GPHOTO2_INTERNAL_CODE
+test_pedantic_c_CFLAGS = \
+ $(PEDANTIC_CFLAGS) $(AM_CFLAGS) $(CFLAGS) \
+ -U_GPHOTO2_INTERNAL_CODE
test_pedantic_c_LDADD = \
$(top_builddir)/libgphoto2/libgphoto2.la \
$(top_builddir)/libgphoto2_port/libgphoto2_port/libgphoto2_port.la \
@@ -67,8 +71,10 @@ test_pedantic_c_LDADD = \
test_pedantic_cxx_SOURCES = test-pedantic-compilation.cxx
test_pedantic_cxx_CPPFLAGS = \
$(AM_CPPFLAGS) $(CPPFLAGS) \
- -U _GPHOTO2_INTERNAL_CODE
-test_pedantic_cxx_CXXFLAGS = $(PEDANTIC_CXXFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+ -U_GPHOTO2_INTERNAL_CODE
+test_pedantic_cxx_CXXFLAGS = \
+ $(PEDANTIC_CXXFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) \
+ -U_GPHOTO2_INTERNAL_CODE
test_pedantic_cxx_LDADD = \
$(top_builddir)/libgphoto2/libgphoto2.la \
$(top_builddir)/libgphoto2_port/libgphoto2_port/libgphoto2_port.la \
diff --git a/tests/test-pedantic-compilation.c b/tests/test-pedantic-compilation.c
index 92898219a..269ea080d 100644
--- a/tests/test-pedantic-compilation.c
+++ b/tests/test-pedantic-compilation.c
@@ -15,7 +15,12 @@
#include <gphoto2/gphoto2-port-result.h>
#include <gphoto2/gphoto2-port-version.h>
+#include <stdio.h>
+
+unsigned long stdc_version = __STDC_VERSION__;
+
int main()
{
+ printf("stdc_version = %lu\n", stdc_version);
return 0;
}
diff --git a/tests/test-pedantic-compilation.cxx b/tests/test-pedantic-compilation.cxx
index 92898219a..70bac2f2b 100644
--- a/tests/test-pedantic-compilation.cxx
+++ b/tests/test-pedantic-compilation.cxx
@@ -15,7 +15,12 @@
#include <gphoto2/gphoto2-port-result.h>
#include <gphoto2/gphoto2-port-version.h>
+#include <stdio.h>
+
+unsigned long cxx_version = __cplusplus;
+
int main()
{
+ printf("cxx_version = %lu\n", cxx_version);
return 0;
}