Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,17 @@ if test "x$with_bundled_catch" = xyes; then
catch_summary="bundled; $catch_CFLAGS $catch_LIBS"
else
SAVE_CPPFLAGS=$CPPFLAGS
CPPFLAGS="-std=c++11 $CPPFLAGS -I/usr/include/catch"
CPPFLAGS="-std=c++17 $CPPFLAGS -I/usr/include/catch2"
AC_LANG_PUSH([C++])
AC_CHECK_HEADER([catch.hpp], [], [AC_MSG_FAILURE(catch.hpp not found or not
usable. Re-run with --with-bundled-catch to use the bundled library.)])
AC_CHECK_HEADER([catch_test_macros.hpp],
[catch_CFLAGS="-I/usr/include/catch2 -DHAVE_CATCH2_V3"
catch_LIBS="-lCatch2Main -lCatch2"],
[AC_CHECK_HEADER([catch.hpp],
[catch_CFLAGS="-I/usr/include/catch2"
catch_LIBS=""],
[AC_MSG_FAILURE(Catch2 not found or not usable. Re-run with --with-bundled-catch to use the bundled library.)]
)])
AC_LANG_POP
catch_CFLAGS="-I/usr/include/catch"
catch_LIBS=""
CPPFLAGS=$SAVE_CPPFLAGS
catch_summary="system-wide;
$catch_CFLAGS $catch_LIBS"
Expand All @@ -165,7 +169,7 @@ AC_ARG_ENABLE(
)

CXXFLAGS=" $EXTERNAL_CXXFLAGS"
CXXFLAGS+=" -std=c++11"
CXXFLAGS+=" -std=c++17"
CXXFLAGS+=" -pedantic"
CXXFLAGS+=" -Wno-unknown-pragmas"
CXXFLAGS+=" -Wall"
Expand Down
3 changes: 3 additions & 0 deletions src/Tests/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,6 @@ test_unit_SOURCES=\
../NotifierCLI.cpp \
../Serializer.hpp \
../Serializer.cpp

test_unit_LDADD = \
$(catch_LIBS)
4 changes: 4 additions & 0 deletions src/Tests/Unit/test_notifier_cli.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#include "NotifierCLI.hpp"

#ifdef HAVE_CATCH2_V3
#include <catch_test_macros.hpp>
#else
#include <catch.hpp>
#endif

using namespace usbguardNotifier;

Expand Down
4 changes: 4 additions & 0 deletions src/Tests/main.cpp
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
#ifdef HAVE_CATCH2_V3
#include <catch_test_macros.hpp>
#else
#define CATCH_CONFIG_MAIN
#include <catch.hpp>
#endif