mirror of https://gitee.com/bigwinds/arangodb
expose ARANGODB_USE_CATCH_TESTS define, make TEST_VIRTUAL be based on it (#8410)
This commit is contained in:
parent
b211277870
commit
a1897d4e84
|
@ -766,9 +766,7 @@ endif ()
|
|||
|
||||
option(USE_CATCH_TESTS "Compile catch C++ tests" ON)
|
||||
if (USE_CATCH_TESTS)
|
||||
add_definitions("-DTEST_VIRTUAL=virtual")
|
||||
else()
|
||||
add_definitions("-DTEST_VIRTUAL=")
|
||||
add_definitions("-DARANGODB_USE_CATCH_TESTS=1")
|
||||
endif()
|
||||
|
||||
include(debugInformation)
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
namespace arangodb {
|
||||
|
||||
// used by catch tests
|
||||
#ifdef USE_CATCH_TESTS
|
||||
#ifdef ARANGODB_USE_CATCH_TESTS
|
||||
/*static*/ FlushFeature::DefaultFlushSubscription FlushFeature::_defaultFlushSubscription;
|
||||
#endif
|
||||
|
||||
|
@ -656,7 +656,7 @@ std::shared_ptr<FlushFeature::FlushSubscription> FlushFeature::registerFlushSubs
|
|||
return subscription;
|
||||
}
|
||||
|
||||
#ifdef USE_CATCH_TESTS
|
||||
#ifdef ARANGODB_USE_CATCH_TESTS
|
||||
if (_defaultFlushSubscription) {
|
||||
struct DelegatingFlushSubscription: public FlushSubscriptionBase {
|
||||
DefaultFlushSubscription _delegate;
|
||||
|
|
|
@ -23,16 +23,6 @@
|
|||
#ifndef ARANGODB_REST_SERVER_FLUSH_FEATURE_H
|
||||
#define ARANGODB_REST_SERVER_FLUSH_FEATURE_H 1
|
||||
|
||||
#if !defined(USE_CATCH_TESTS) && !defined(EXPAND_ARANGODB_REST_SERVER_FLUSH_FEATURE_H)
|
||||
#define DO_EXPAND_ARANGODB_REST_SERVER_FLUSH_FEATURE_H(VAL) VAL ## 1
|
||||
#define EXPAND_ARANGODB_REST_SERVER_FLUSH_FEATURE_H(VAL) DO_EXPAND_ARANGODB_REST_SERVER_FLUSH_FEATURE_H(VAL)
|
||||
#if defined(TEST_VIRTUAL) && (EXPAND_ARANGODB_REST_SERVER_FLUSH_FEATURE_H(TEST_VIRTUAL) != 1)
|
||||
#define USE_CATCH_TESTS
|
||||
#endif
|
||||
#undef EXPAND_ARANGODB_REST_SERVER_FLUSH_FEATURE_H
|
||||
#undef DO_EXPAND_ARANGODB_REST_SERVER_FLUSH_FEATURE_H
|
||||
#endif
|
||||
|
||||
#include "ApplicationFeatures/ApplicationFeature.h"
|
||||
#include "Basics/ReadWriteLock.h"
|
||||
|
||||
|
@ -60,7 +50,7 @@ class FlushFeature final : public application_features::ApplicationFeature {
|
|||
class FlushSubscriptionBase; // forward declaration
|
||||
|
||||
// used by catch tests
|
||||
#ifdef USE_CATCH_TESTS
|
||||
#ifdef ARANGODB_USE_CATCH_TESTS
|
||||
typedef std::function<Result(std::string const&, TRI_vocbase_t const&, velocypack::Slice const&)> DefaultFlushSubscription;
|
||||
static DefaultFlushSubscription _defaultFlushSubscription;
|
||||
#endif
|
||||
|
@ -117,4 +107,4 @@ class FlushFeature final : public application_features::ApplicationFeature {
|
|||
|
||||
} // namespace arangodb
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -192,6 +192,13 @@ typedef long suseconds_t;
|
|||
// Windows debug mode also seems to define DEBUG preproc symbol
|
||||
#undef DEBUG
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef ARANGODB_USE_CATCH_TESTS
|
||||
#define TEST_VIRTUAL virtual
|
||||
#else
|
||||
#define TEST_VIRTUAL
|
||||
#endif
|
||||
|
||||
/// @brief helper macro for calculating strlens for static strings at
|
||||
/// a compile-time (unless compiled with fno-builtin-strlen etc.)
|
||||
|
|
Loading…
Reference in New Issue