Add support for PlayStation platforms (#2562)

* Add new `CATCH_CONFIG` option for using `std::getenv`, because PS does not support env vars
* Add PS to platforms that have disabled posix signals.
* Small workaround for PS toolchain bug that prevents it from compiling `std::set` with lambda based comparator.
This commit is contained in:
Masashi Fujita
2022-11-09 22:47:55 +09:00
committed by GitHub
parent f8006aa6d4
commit b7f4a2efb8
8 changed files with 49 additions and 14 deletions

View File

@@ -118,19 +118,25 @@
////////////////////////////////////////////////////////////////////////////////
// Assume that non-Windows platforms support posix signals by default
#if !defined(CATCH_PLATFORM_WINDOWS)
#define CATCH_INTERNAL_CONFIG_POSIX_SIGNALS
// We know some environments not to support full POSIX signals
#if defined( CATCH_PLATFORM_WINDOWS ) || \
defined( CATCH_PLATFORM_PLAYSTATION ) || \
defined( __CYGWIN__ ) || \
defined( __QNX__ ) || \
defined( __EMSCRIPTEN__ ) || \
defined( __DJGPP__ ) || \
defined( __OS400__ )
# define CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS
#else
# define CATCH_INTERNAL_CONFIG_POSIX_SIGNALS
#endif
////////////////////////////////////////////////////////////////////////////////
// We know some environments not to support full POSIX signals
#if defined(__CYGWIN__) || defined(__QNX__) || defined(__EMSCRIPTEN__) || defined(__DJGPP__)
#define CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS
#endif
#ifdef __OS400__
# define CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS
// Assume that some platforms do not support getenv.
#if defined(CATCH_PLATFORM_WINDOWS_UWP) || defined(CATCH_PLATFORM_PLAYSTATION)
# define CATCH_INTERNAL_CONFIG_NO_GETENV
#else
# define CATCH_INTERNAL_CONFIG_GETENV
#endif
////////////////////////////////////////////////////////////////////////////////
@@ -273,6 +279,10 @@
# define CATCH_CONFIG_POSIX_SIGNALS
#endif
#if defined(CATCH_INTERNAL_CONFIG_GETENV) && !defined(CATCH_INTERNAL_CONFIG_NO_GETENV) && !defined(CATCH_CONFIG_NO_GETENV) && !defined(CATCH_CONFIG_GETENV)
# define CATCH_CONFIG_GETENV
#endif
#if !defined(CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING) && !defined(CATCH_CONFIG_NO_CPP11_TO_STRING) && !defined(CATCH_CONFIG_CPP11_TO_STRING)
# define CATCH_CONFIG_CPP11_TO_STRING
#endif