summarylogtreecommitdiffstats
path: root/use_system_catch2.patch
blob: 3dd753ff4f8f2fe9db236391636d2c33dbce70aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b0de85d..dcb083b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,9 +2,6 @@ cmake_minimum_required(VERSION 3.1.3)
 
 project(GSL CXX)
 
-include(ExternalProject)
-find_package(Git)
-
 # creates a library GSL which is an interface (header files only)
 add_library(GSL INTERFACE)
 
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 2d37a51..93a3a3f 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -5,26 +5,9 @@ project(GSLTests CXX)
 # will make visual studio generated project group files
 set_property(GLOBAL PROPERTY USE_FOLDERS ON)
 
-list(APPEND CATCH_CMAKE_ARGS
-    "-DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/external"
-    "-DNO_SELFTEST=true"
-)
-
-if(GIT_FOUND)
-    # add catch
-    ExternalProject_Add(
-        catch
-        PREFIX ${CMAKE_BINARY_DIR}/catch
-        GIT_REPOSITORY https://github.com/catchorg/Catch2.git
-        GIT_TAG v2.0.1
-        CMAKE_ARGS ${CATCH_CMAKE_ARGS}
-        LOG_DOWNLOAD 1
-        UPDATE_DISCONNECTED 1
-    )
-else()
-    # assume catch is installed in a system directory
-    add_custom_target(catch)
-endif()
+# assume catch is installed in a system directory
+find_package(Catch2 REQUIRED)
+add_custom_target(catch)
 
 if (MSVC AND (GSL_CXX_STANDARD EQUAL 17))
     set(GSL_CPLUSPLUS_OPT -Zc:__cplusplus -permissive-)
diff --git a/tests/algorithm_tests.cpp b/tests/algorithm_tests.cpp
index 368b53d..405dd83 100644
--- a/tests/algorithm_tests.cpp
+++ b/tests/algorithm_tests.cpp
@@ -20,7 +20,7 @@
 #pragma warning(disable : 26440 26426) // from catch
 #endif
 
-#include <catch/catch.hpp> // for AssertionHandler, StringRef, CHECK, CHE...
+#include <catch2/catch.hpp> // for AssertionHandler, StringRef, CHECK, CHE...
 
 #include <gsl/gsl_algorithm> // for copy
 #include <gsl/span>          // for span
diff --git a/tests/assertion_tests.cpp b/tests/assertion_tests.cpp
index 0c509ad..0b7083a 100644
--- a/tests/assertion_tests.cpp
+++ b/tests/assertion_tests.cpp
@@ -20,7 +20,7 @@
 #pragma warning(disable : 26440 26426) // from catch
 #endif
 
-#include <catch/catch.hpp> // for AssertionHandler, StringRef, CHECK, CHECK...
+#include <catch2/catch.hpp> // for AssertionHandler, StringRef, CHECK, CHECK...
 
 #include <gsl/gsl_assert> // for fail_fast (ptr only), Ensures, Expects
 
diff --git a/tests/at_tests.cpp b/tests/at_tests.cpp
index 7f07be0..c254ce9 100644
--- a/tests/at_tests.cpp
+++ b/tests/at_tests.cpp
@@ -20,7 +20,7 @@
 #pragma warning(disable : 26440 26426) // from catch
 #endif
 
-#include <catch/catch.hpp> // for AssertionHandler, StringRef, CHECK_THROW...
+#include <catch2/catch.hpp> // for AssertionHandler, StringRef, CHECK_THROW...
 
 #include <gsl/gsl_util> // for at
 
diff --git a/tests/bounds_tests.cpp b/tests/bounds_tests.cpp
index e586d44..2ada0f3 100644
--- a/tests/bounds_tests.cpp
+++ b/tests/bounds_tests.cpp
@@ -20,7 +20,7 @@
 #pragma warning(disable : 26440 26426) // from catch
 #endif
 
-#include <catch/catch.hpp> // for AssertionHandler, StringRef, TEST_CASE
+#include <catch2/catch.hpp> // for AssertionHandler, StringRef, TEST_CASE
 
 #include <gsl/multi_span> // for static_bounds, static_bounds_dynamic_range_t
 
diff --git a/tests/byte_tests.cpp b/tests/byte_tests.cpp
index d6634bb..90afd7d 100644
--- a/tests/byte_tests.cpp
+++ b/tests/byte_tests.cpp
@@ -20,7 +20,7 @@
 #pragma warning(disable : 26440 26426) // from catch
 #endif
 
-#include <catch/catch.hpp> // for AssertionHandler, StringRef, CHECK, TEST_...
+#include <catch2/catch.hpp> // for AssertionHandler, StringRef, CHECK, TEST_...
 
 #include <gsl/gsl_byte> // for to_byte, to_integer, byte, operator&, ope...
 
diff --git a/tests/multi_span_tests.cpp b/tests/multi_span_tests.cpp
index 9c05cb4..70fe628 100644
--- a/tests/multi_span_tests.cpp
+++ b/tests/multi_span_tests.cpp
@@ -21,7 +21,7 @@
 
 #endif
 
-#include <catch/catch.hpp> // for AssertionHandler, StringRef, CHECK, CHECK...
+#include <catch2/catch.hpp> // for AssertionHandler, StringRef, CHECK, CHECK...
 
 #include <gsl/gsl_byte>   // for byte
 #include <gsl/gsl_util>   // for narrow_cast
diff --git a/tests/notnull_tests.cpp b/tests/notnull_tests.cpp
index 668c0a2..4516d95 100644
--- a/tests/notnull_tests.cpp
+++ b/tests/notnull_tests.cpp
@@ -23,7 +23,7 @@
 #pragma warning(disable : 4702) // unreachable code
 #endif
 
-#include <catch/catch.hpp> // for AssertionHandler, StringRef, CHECK, TEST_...
+#include <catch2/catch.hpp> // for AssertionHandler, StringRef, CHECK, TEST_...
 
 #include <gsl/pointers>       // for not_null, operator<, operator<=, operator>
 
diff --git a/tests/owner_tests.cpp b/tests/owner_tests.cpp
index 9fff184..b450878 100644
--- a/tests/owner_tests.cpp
+++ b/tests/owner_tests.cpp
@@ -21,7 +21,7 @@
 
 #endif
 
-#include <catch/catch.hpp> // for AssertionHandler, StringRef, CHECK, TEST_...
+#include <catch2/catch.hpp> // for AssertionHandler, StringRef, CHECK, TEST_...
 
 #include <gsl/pointers> // for owner
 
diff --git a/tests/sloppy_notnull_tests.cpp b/tests/sloppy_notnull_tests.cpp
index 51983f5..be897ed 100644
--- a/tests/sloppy_notnull_tests.cpp
+++ b/tests/sloppy_notnull_tests.cpp
@@ -23,7 +23,7 @@
 #pragma warning(disable : 4702) // unreachable code
 #endif
 
-#include <catch/catch.hpp>    // for AssertionHandler, StringRef, CHECK, TEST_...
+#include <catch2/catch.hpp>    // for AssertionHandler, StringRef, CHECK, TEST_...
 
 #include <gsl/pointers>           // for not_null, operator<, operator<=, operator>
 #include <samples/gsl_transition> // for sloppy_not_null
diff --git a/tests/span_tests.cpp b/tests/span_tests.cpp
index 07a59c8..a53fd0c 100644
--- a/tests/span_tests.cpp
+++ b/tests/span_tests.cpp
@@ -21,7 +21,7 @@
 
 #endif
 
-#include <catch/catch.hpp> // for AssertionHandler, StringRef, CHECK, TEST_...
+#include <catch2/catch.hpp> // for AssertionHandler, StringRef, CHECK, TEST_...
 
 #include <gsl/gsl_byte> // for byte
 #include <gsl/gsl_util> // for narrow_cast, at
diff --git a/tests/strided_span_tests.cpp b/tests/strided_span_tests.cpp
index 2310f5b..b74a49d 100644
--- a/tests/strided_span_tests.cpp
+++ b/tests/strided_span_tests.cpp
@@ -21,7 +21,7 @@
 
 #endif
 
-#include <catch/catch.hpp> // for AssertionHandler, StringRef, CHECK, CHECK...
+#include <catch2/catch.hpp> // for AssertionHandler, StringRef, CHECK, CHECK...
 
 #include <gsl/gsl_byte>   // for byte
 #include <gsl/gsl_util>   // for narrow_cast
diff --git a/tests/string_span_tests.cpp b/tests/string_span_tests.cpp
index fd3e3e6..b5fa610 100644
--- a/tests/string_span_tests.cpp
+++ b/tests/string_span_tests.cpp
@@ -21,7 +21,7 @@
 
 #endif
 
-#include <catch/catch.hpp> // for AssertionHandler, StringRef, CHECK, TEST_...
+#include <catch2/catch.hpp> // for AssertionHandler, StringRef, CHECK, TEST_...
 
 #include <gsl/gsl_assert>  // for Expects, fail_fast (ptr only)
 #include <gsl/pointers>    // for owner
diff --git a/tests/test.cpp b/tests/test.cpp
index dbdebb6..cb81423 100644
--- a/tests/test.cpp
+++ b/tests/test.cpp
@@ -23,4 +23,4 @@
 #pragma warning(disable : 26401 26409 26415 26418 26426 26429 26432 26433 26434 26435 26436 26439 26440 26443 26444 26446 26447 26451 26460 26461 26466 26472 26481 26482 26485 26492 26493 26494 26495 26496 26497) // from catch
 #endif // _MSC_VER
 
-#include <catch/catch.hpp>
+#include <catch2/catch.hpp>
diff --git a/tests/utils_tests.cpp b/tests/utils_tests.cpp
index 05f8d0f..978c87d 100644
--- a/tests/utils_tests.cpp
+++ b/tests/utils_tests.cpp
@@ -21,7 +21,7 @@
 
 #endif
 
-#include <catch/catch.hpp> // for AssertionHandler, StringRef, CHECK, TEST_...
+#include <catch2/catch.hpp> // for AssertionHandler, StringRef, CHECK, TEST_...
 
 #include <gsl/gsl_util> // for narrow, finally, narrow_cast, narrowing_e...