Skip to content

Commit e8b011e

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. The first guard here is module_dependencies.txt, where only testing-utils must have "catch" listed. The second line of defense is a macro that must be set.
1 parent 7c44567 commit e8b011e

File tree

4 files changed

+13
-1
lines changed

4 files changed

+13
-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: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ Author: Michael Tautschnig
2828
// signed/unsigned mismatch
2929
#endif
3030

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

3335
#ifdef _MSC_VER
3436
#include <util/pragma_pop.def>

0 commit comments

Comments
 (0)