diff --git a/src/stdafx.h b/src/stdafx.h index a46b7270d8..703cc1bfdf 100644 --- a/src/stdafx.h +++ b/src/stdafx.h @@ -202,7 +202,7 @@ #endif /* defined(_MSC_VER) */ -#if !defined(STRGEN) && !defined(SETTINGSGEN) +#if !defined(STRGEN) && !defined(SETTINGSGEN) && !defined(OPENTTD_TEST) # if defined(_WIN32) char *getcwd(char *buf, size_t size); # include @@ -222,7 +222,7 @@ template std::string FS2OTTD(T name) { return name; } template std::string OTTD2FS(T name) { return name; } # endif /* _WIN32 or WITH_ICONV */ -#endif /* STRGEN || SETTINGSGEN */ +#endif /* STRGEN || SETTINGSGEN || OPENTTD_TEST */ #if defined(_WIN32) # define PATHSEP "\\" diff --git a/src/tests/bitmath_func.cpp b/src/tests/bitmath_func.cpp index 5f5f7c79bb..dfd6365f78 100644 --- a/src/tests/bitmath_func.cpp +++ b/src/tests/bitmath_func.cpp @@ -7,6 +7,7 @@ /** @file bitmath_func_test.cpp Test functionality from core/bitmath_func. */ +#define OPENTTD_TEST #include "../stdafx.h" #include "../3rdparty/catch2/catch.hpp" diff --git a/src/tests/landscape_partial_pixel_z.cpp b/src/tests/landscape_partial_pixel_z.cpp index f5c22786f7..26b7c70892 100644 --- a/src/tests/landscape_partial_pixel_z.cpp +++ b/src/tests/landscape_partial_pixel_z.cpp @@ -7,6 +7,7 @@ /** @file landscape_partial_pixel_z.cpp Tests for consistency/validity of the results of GetPartialPixelZ. */ +#define OPENTTD_TEST #include "../stdafx.h" #include "../3rdparty/catch2/catch.hpp" diff --git a/src/tests/math_func.cpp b/src/tests/math_func.cpp index 45667b9012..2b2ecaf24e 100644 --- a/src/tests/math_func.cpp +++ b/src/tests/math_func.cpp @@ -7,6 +7,7 @@ /** @file math_func_test.cpp Test functionality from core/math_func. */ +#define OPENTTD_TEST #include "../stdafx.h" #include "../3rdparty/catch2/catch.hpp" diff --git a/src/tests/ring_buffer.cpp b/src/tests/ring_buffer.cpp index 5075af538b..1de6ecea37 100644 --- a/src/tests/ring_buffer.cpp +++ b/src/tests/ring_buffer.cpp @@ -7,6 +7,7 @@ /** @file ring_buffer.cpp Test functionality from core/ring_buffer.hpp */ +#define OPENTTD_TEST #include "../stdafx.h" #include "../3rdparty/catch2/catch.hpp" diff --git a/src/tests/test_main.cpp b/src/tests/test_main.cpp index 85649aea01..8a4d058fbc 100644 --- a/src/tests/test_main.cpp +++ b/src/tests/test_main.cpp @@ -7,6 +7,7 @@ /** @file test_main.cpp Entry point for all the unit tests. */ +#define OPENTTD_TEST #include "../stdafx.h" #include