Add C++ unit test
authorOlivier Dion <odion@efficios.com>
Mon, 19 Aug 2024 17:36:08 +0000 (13:36 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 23 Oct 2024 15:37:24 +0000 (11:37 -0400)
Change-Id: I79e850e40b4e7d97f859b7ada8f1f6708ca3395f
Signed-off-by: Olivier Dion <odion@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
tests/Makefile.am
tests/unit/test-cxx.cpp [new file with mode: 0644]

index e92b7f4217147eb415311f552a698981e42e1844..9d8702c255474a97b12544304e849c19ba7cf04f 100644 (file)
@@ -15,6 +15,7 @@ TAP_LOG_DRIVER = env AM_TAP_AWK='$(AWK)' \
 noinst_PROGRAMS = \
        regression/side-rcu-test \
        unit/test \
+       unit/test-cxx \
        unit/demo \
        unit/statedump
 
@@ -31,6 +32,12 @@ unit_test_LDADD = \
        $(top_builddir)/tests/utils/libtap.la \
        $(RSEQ_LIBS)
 
+unit_test_cxx_SOURCES = unit/test-cxx.cpp
+unit_test_cxx_LDADD = \
+       $(top_builddir)/src/libside.la \
+       $(top_builddir)/tests/utils/libtap.la \
+       $(RSEQ_LIBS)
+
 unit_demo_SOURCES = unit/demo.c
 unit_demo_LDADD = \
        $(top_builddir)/src/libside.la \
diff --git a/tests/unit/test-cxx.cpp b/tests/unit/test-cxx.cpp
new file mode 100644 (file)
index 0000000..f911cd2
--- /dev/null
@@ -0,0 +1,9 @@
+/*
+ * Tests from C ought to work in C++.  The pragmas are for ignoring the
+ * narrowing of `double' literal values to `FloatN' in the tests, which emitted
+ * warnings.
+ */
+#if defined(__GNUC__)
+#pragma GCC diagnostic ignored "-Wnarrowing"
+#endif
+#include "test.c"
This page took 0.023821 seconds and 4 git commands to generate.