Fix test compilation on MacOS

This commit is contained in:
Jonathan G Rennison
2023-11-09 21:06:17 +00:00
parent 57f50b4a40
commit 79b5699e82
6 changed files with 7 additions and 2 deletions

View File

@@ -202,7 +202,7 @@
#endif /* defined(_MSC_VER) */ #endif /* defined(_MSC_VER) */
#if !defined(STRGEN) && !defined(SETTINGSGEN) #if !defined(STRGEN) && !defined(SETTINGSGEN) && !defined(OPENTTD_TEST)
# if defined(_WIN32) # if defined(_WIN32)
char *getcwd(char *buf, size_t size); char *getcwd(char *buf, size_t size);
# include <io.h> # include <io.h>
@@ -222,7 +222,7 @@
template <typename T> std::string FS2OTTD(T name) { return name; } template <typename T> std::string FS2OTTD(T name) { return name; }
template <typename T> std::string OTTD2FS(T name) { return name; } template <typename T> std::string OTTD2FS(T name) { return name; }
# endif /* _WIN32 or WITH_ICONV */ # endif /* _WIN32 or WITH_ICONV */
#endif /* STRGEN || SETTINGSGEN */ #endif /* STRGEN || SETTINGSGEN || OPENTTD_TEST */
#if defined(_WIN32) #if defined(_WIN32)
# define PATHSEP "\\" # define PATHSEP "\\"

View File

@@ -7,6 +7,7 @@
/** @file bitmath_func_test.cpp Test functionality from core/bitmath_func. */ /** @file bitmath_func_test.cpp Test functionality from core/bitmath_func. */
#define OPENTTD_TEST
#include "../stdafx.h" #include "../stdafx.h"
#include "../3rdparty/catch2/catch.hpp" #include "../3rdparty/catch2/catch.hpp"

View File

@@ -7,6 +7,7 @@
/** @file landscape_partial_pixel_z.cpp Tests for consistency/validity of the results of GetPartialPixelZ. */ /** @file landscape_partial_pixel_z.cpp Tests for consistency/validity of the results of GetPartialPixelZ. */
#define OPENTTD_TEST
#include "../stdafx.h" #include "../stdafx.h"
#include "../3rdparty/catch2/catch.hpp" #include "../3rdparty/catch2/catch.hpp"

View File

@@ -7,6 +7,7 @@
/** @file math_func_test.cpp Test functionality from core/math_func. */ /** @file math_func_test.cpp Test functionality from core/math_func. */
#define OPENTTD_TEST
#include "../stdafx.h" #include "../stdafx.h"
#include "../3rdparty/catch2/catch.hpp" #include "../3rdparty/catch2/catch.hpp"

View File

@@ -7,6 +7,7 @@
/** @file ring_buffer.cpp Test functionality from core/ring_buffer.hpp */ /** @file ring_buffer.cpp Test functionality from core/ring_buffer.hpp */
#define OPENTTD_TEST
#include "../stdafx.h" #include "../stdafx.h"
#include "../3rdparty/catch2/catch.hpp" #include "../3rdparty/catch2/catch.hpp"

View File

@@ -7,6 +7,7 @@
/** @file test_main.cpp Entry point for all the unit tests. */ /** @file test_main.cpp Entry point for all the unit tests. */
#define OPENTTD_TEST
#include "../stdafx.h" #include "../stdafx.h"
#include <stdarg.h> #include <stdarg.h>