Skip to content

Commit 22e7c3b

Browse files
committed
unittestframework: prefer doctest/doctest.h
1 parent b79a0bd commit 22e7c3b

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

tests/unittestframework.h

+14-4
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,14 @@
2020
#endif
2121
//#define CATCH_CONFIG_ENABLE_TUPLE_STRINGMAKER
2222
#define CATCH_CONFIG_ENABLE_ALL_STRINGMAKERS
23-
#if __has_include("catch2/catch.hpp")
23+
#if __has_include(<catch2/catch.hpp>)
2424
#include <catch2/catch.hpp>
25+
#elif __has_include("single_include/catch.hpp")
26+
#include "single_include/catch.hpp"
2527
#elif __has_include("contrib/catch.hpp")
2628
#include "contrib/catch.hpp"
29+
#else
30+
#error "Could not find catch.hpp"
2731
#endif
2832

2933
#define SKIPTEST , "[!hide]"
@@ -36,10 +40,14 @@
3640
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
3741
#endif
3842
#include <ostream>
39-
#if __has_include("contrib/doctest.h")
43+
#if __has_include(<doctest/doctest.h>)
44+
#include <doctest/doctest.h>
45+
#elif __has_include("single_include/doctest.h")
46+
#include "single_include/doctest.h"
47+
#elif __has_include("contrib/doctest.h")
4048
#include "contrib/doctest.h"
41-
#elif __has_include("doctest/doctest.h")
42-
#include "doctest/doctest.h"
49+
#else
50+
#error "Could not find doctest.h"
4351
#endif
4452
#define SECTION(...) SUBCASE(__VA_ARGS__)
4553
#define SKIPTEST * doctest::skip(true)
@@ -48,3 +56,5 @@
4856
#else
4957
#error define either USE_CATCH or USE_DOCTEST
5058
#endif
59+
60+
#define IN_UNITTEST 1

0 commit comments

Comments
 (0)