Commit 064c1674 authored by Uri Lublin's avatar Uri Lublin Committed by Frediano Ziglio

catch: check for any of catch and catch2

Catch2 is now in upstream (github) and Fedora (since Fedora 27)
Signed-off-by: Uri Lublin's avatarUri Lublin <uril@redhat.com>
Acked-by: Frediano Ziglio's avatarFrediano Ziglio <fziglio@redhat.com>
parent d637287c
Pipeline #18189 passed with stage
in 7 minutes and 31 seconds
......@@ -119,9 +119,11 @@ case "$enable_tests" in
*) AC_MSG_ERROR([bad value ${enable_tests} for enable-tests option]) ;;
esac
AS_IF([test "x$enable_tests" != "xno"],
[AC_CHECK_HEADER([catch/catch.hpp],have_check="yes",)])
[AC_CHECK_HEADERS([catch/catch.hpp], have_check="yes")
AC_CHECK_HEADERS([catch2/catch.hpp], have_check="yes")])
AS_IF([test "x$enable_tests" = "xyes" && test "x$have_check" != "xyes"],
[AC_MSG_ERROR([Could not find Catch dependency header (catch/catch.hpp)])])
[AC_MSG_ERROR([Could not find Catch dependency header (catch.hpp)])])
AM_CONDITIONAL([ENABLE_TESTS], [test "x$have_check" = "xyes"])
AC_DEFINE_DIR([BINDIR], [bindir], [Where binaries are installed.])
......
......@@ -49,6 +49,7 @@ test_mjpeg_fallback_SOURCES = \
../mjpeg-fallback.cpp \
../utils.cpp \
../x11-display-info.cpp \
spice-catch.hpp \
$(NULL)
test_mjpeg_fallback_LDADD = \
......@@ -61,6 +62,7 @@ test_mjpeg_fallback_LDADD = \
test_stream_port_SOURCES = \
test-stream-port.cpp \
../stream-port.cpp \
spice-catch.hpp \
$(NULL)
EXTRA_DIST = \
......
/*
* Include catch/catch.hpp or catch2/catch.hpp
* according to what configure found
*
* \copyright
* Copyright 2019 Red Hat Inc. All rights reserved.
*/
#ifndef SPICE_CATCH_HPP
#include <config.h>
#if defined(HAVE_CATCH2_CATCH_HPP)
#include <catch2/catch.hpp>
#elif defined(HAVE_CATCH_CATCH_HPP)
#include <catch/catch.hpp>
#endif
#endif // SPICE_CATCH_HPP
#define CATCH_CONFIG_MAIN
#include "catch/catch.hpp"
#include "spice-catch.hpp"
#include "mjpeg-fallback.hpp"
......
......@@ -5,7 +5,7 @@
*/
#define CATCH_CONFIG_MAIN
#include <catch/catch.hpp>
#include "spice-catch.hpp"
#include <sys/socket.h>
#include <signal.h>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment