mirror of
https://github.com/google/googletest.git
synced 2026-07-30 16:26:24 +08:00
Merge 55da83185f39dd0b198e20a135eeee3b2865125e into a0f06a70e3da7afa88da9527c43951bca1f7cef2
This commit is contained in:
commit
6d98087682
@ -84,6 +84,9 @@
|
|||||||
#define GTEST_OS_GNU_HURD 1
|
#define GTEST_OS_GNU_HURD 1
|
||||||
#elif defined(__GLIBC__) && defined(__FreeBSD_kernel__)
|
#elif defined(__GLIBC__) && defined(__FreeBSD_kernel__)
|
||||||
#define GTEST_OS_GNU_KFREEBSD 1
|
#define GTEST_OS_GNU_KFREEBSD 1
|
||||||
|
#elif defined(__ZEPHYR__)
|
||||||
|
// Define it before linux as it could be built as a linux application
|
||||||
|
#define GTEST_OS_ZEPHYR 1
|
||||||
#elif defined __linux__
|
#elif defined __linux__
|
||||||
#define GTEST_OS_LINUX 1
|
#define GTEST_OS_LINUX 1
|
||||||
#if defined __ANDROID__
|
#if defined __ANDROID__
|
||||||
|
|||||||
@ -141,6 +141,7 @@
|
|||||||
// GTEST_OS_WINDOWS_PHONE - Windows Phone
|
// GTEST_OS_WINDOWS_PHONE - Windows Phone
|
||||||
// GTEST_OS_WINDOWS_RT - Windows Store App/WinRT
|
// GTEST_OS_WINDOWS_RT - Windows Store App/WinRT
|
||||||
// GTEST_OS_ZOS - z/OS
|
// GTEST_OS_ZOS - z/OS
|
||||||
|
// GTEST_OS_ZEPHYR - Zephyr OS
|
||||||
//
|
//
|
||||||
// Among the platforms, Cygwin, Linux, Mac OS X, and Windows have the
|
// Among the platforms, Cygwin, Linux, Mac OS X, and Windows have the
|
||||||
// most stable support. Since core members of the Google Test project
|
// most stable support. Since core members of the Google Test project
|
||||||
@ -516,6 +517,10 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
|
|||||||
#endif
|
#endif
|
||||||
#endif // GTEST_HAS_STD_WSTRING
|
#endif // GTEST_HAS_STD_WSTRING
|
||||||
|
|
||||||
|
#ifdef GTEST_OS_ZEPHYR
|
||||||
|
#define GTEST_HAS_FILE_SYSTEM 0
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef GTEST_HAS_FILE_SYSTEM
|
#ifndef GTEST_HAS_FILE_SYSTEM
|
||||||
// Most platforms support a file system.
|
// Most platforms support a file system.
|
||||||
#define GTEST_HAS_FILE_SYSTEM 1
|
#define GTEST_HAS_FILE_SYSTEM 1
|
||||||
@ -2063,6 +2068,18 @@ inline int RmDir(const char* dir) { return rmdir(dir); }
|
|||||||
inline bool IsDir(const StatStruct& st) { return S_ISDIR(st.st_mode); }
|
inline bool IsDir(const StatStruct& st) { return S_ISDIR(st.st_mode); }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#elif defined(GTEST_OS_ZEPHYR)
|
||||||
|
static inline int FileNo(FILE* file) {
|
||||||
|
if (file == stdin)
|
||||||
|
return 1;
|
||||||
|
else if (file == stdout)
|
||||||
|
return 2;
|
||||||
|
else if (file == stderr)
|
||||||
|
return 3;
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline int isatty(int fd) { return true; }
|
||||||
#else
|
#else
|
||||||
|
|
||||||
typedef struct stat StatStruct;
|
typedef struct stat StatStruct;
|
||||||
|
|||||||
@ -43,7 +43,9 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <chrono> // NOLINT
|
#include <chrono> // NOLINT
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
#ifndef GTEST_OS_ZEPHYR
|
||||||
#include <csignal> // NOLINT: raise(3) is used on some platforms
|
#include <csignal> // NOLINT: raise(3) is used on some platforms
|
||||||
|
#endif
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|||||||
@ -47,13 +47,23 @@ void loop() { RUN_ALL_TESTS(); }
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#elif defined(GTEST_OS_QURT)
|
#elif defined(GTEST_OS_QURT) || defined(GTEST_OS_ZEPHYR)
|
||||||
// QuRT: program entry point is main, but argc/argv are unusable.
|
// Program entry point is main, but argc/argv are unusable.
|
||||||
|
|
||||||
|
#if defined(GTEST_OS_ZEPHYR)
|
||||||
|
#undef GTEST_API_
|
||||||
|
#define GTEST_API_
|
||||||
|
#endif
|
||||||
|
|
||||||
GTEST_API_ int main() {
|
GTEST_API_ int main() {
|
||||||
printf("Running main() from %s\n", __FILE__);
|
printf("Running main() from %s\n", __FILE__);
|
||||||
testing::InitGoogleTest();
|
testing::InitGoogleTest();
|
||||||
return RUN_ALL_TESTS();
|
|
||||||
|
int ret = RUN_ALL_TESTS();
|
||||||
|
#if defined(GTEST_OS_ZEPHYR)
|
||||||
|
_exit( ret );
|
||||||
|
#endif
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
// Normal platforms: program entry point is main, argc/argv are initialized.
|
// Normal platforms: program entry point is main, argc/argv are initialized.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user