Skip to content

Commit 1ba1e40

Browse files
committed
Move catch.hpp to separate folder
This is to avoid direct inclusion of catch.hpp when use_catch.h should be used instead. One guard here is module_dependencies.txt, where only testing-utils must have "catch" listed, and the second is that the macro INCLUDED_VIA_USE_CATCH_H must be set.
1 parent b459ea5 commit 1ba1e40

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

unit/catch/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
target_include_directories(catch
2+
PUBLIC
3+
${CMAKE_CURRENT_SOURCE_DIR}/..
4+
)

unit/testing-utils/catch.hpp renamed to unit/catch/catch.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
* Distributed under the Boost Software License, Version 1.0. (See accompanying
99
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
1010
*/
11+
12+
#ifndef INCLUDED_VIA_USE_CATCH_H
13+
#error Do not include this file directly, use use_catch.h instead
14+
#endif
15+
1116
#ifndef TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED
1217
#define TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED
1318

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
ansi-c
2+
catch
23
testing-utils
34
util
45
analyses

unit/testing-utils/use_catch.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ Author: Michael Tautschnig
2828
// signed/unsigned mismatch
2929
#endif
3030

31-
#include "catch.hpp"
31+
#define INCLUDED_VIA_USE_CATCH_H
32+
#include <catch/catch.hpp>
3233

3334
#ifdef _MSC_VER
3435
#include <util/pragma_pop.def>

0 commit comments

Comments
 (0)