@@ -17,10 +17,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
17
17
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18
18
*/
19
19
20
- #define CATCH_CONFIG_RUNNER
21
- // we want to have catch write to rawstream (stderr) instead of stdout
22
- #define CATCH_CONFIG_NOSTDOUT
23
- #include < catch.hpp>
20
+ #include " catch.h"
24
21
25
22
#include " test.h"
26
23
@@ -34,18 +31,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
34
31
35
32
#include < iostream>
36
33
37
- // make catch write everything to rawstream
38
- namespace Catch {
39
- std::ostream& cout () {
40
- return rawstream;
41
- }
42
- std::ostream& clog () {
43
- return rawstream;
44
- }
45
- std::ostream& cerr () {
46
- return rawstream;
47
- }
48
- }
34
+ #include " catch.h"
49
35
50
36
content_t t_CONTENT_STONE;
51
37
content_t t_CONTENT_GRASS;
@@ -255,11 +241,16 @@ bool run_tests()
255
241
}
256
242
257
243
rawstream << " Catch test results: " << std::endl;
258
- auto num_catch_tests_failed = Catch::Session ().run ();
259
- // We count the all the Catch tests as one test for Minetest's own logging
244
+ Catch::Session session{};
245
+ auto config = session.configData ();
246
+ config.skipBenchmarks = true ;
247
+ config.allowZeroTests = true ;
248
+ session.useConfigData (config);
249
+ auto exit_code = session.run ();
250
+ // We count all the Catch tests as one test for Minetest's own logging
260
251
// because we don't have a way to tell how many individual tests Catch ran.
261
252
++num_total_tests_run;
262
- if (num_catch_tests_failed > 0 ) {
253
+ if (exit_code != 0 ) {
263
254
++num_modules_failed;
264
255
++num_total_tests_failed;
265
256
}
0 commit comments