diff options
author | Marat Dukhan <maratek@google.com> | 2022-09-21 06:07:33 (GMT) |
---|---|---|
committer | Marat Dukhan <maratek@google.com> | 2022-09-26 21:49:00 (GMT) |
commit | 7a3abfec0aa5255f0ecf246987422493e9ca6a75 (patch) | |
tree | 011816dd1de13a4b3904111033c08dbc798c5115 /googletest/src | |
parent | 1336c4b6d1a6f4bc6beebccb920e5ff858889292 (diff) | |
download | googletest-7a3abfec0aa5255f0ecf246987422493e9ca6a75.zip googletest-7a3abfec0aa5255f0ecf246987422493e9ca6a75.tar.gz googletest-7a3abfec0aa5255f0ecf246987422493e9ca6a75.tar.bz2 |
Port GoogleTest to QuRT (Hexagon RTOS)refs/pull/4016/head
Diffstat (limited to 'googletest/src')
-rw-r--r-- | googletest/src/gtest-filepath.cc | 4 | ||||
-rw-r--r-- | googletest/src/gtest_main.cc | 12 |
2 files changed, 14 insertions, 2 deletions
diff --git a/googletest/src/gtest-filepath.cc b/googletest/src/gtest-filepath.cc index f6ee90c..6767db0 100644 --- a/googletest/src/gtest-filepath.cc +++ b/googletest/src/gtest-filepath.cc @@ -96,7 +96,7 @@ static bool IsPathSeparator(char c) { FilePath FilePath::GetCurrentDir() { #if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_WINDOWS_PHONE || \ GTEST_OS_WINDOWS_RT || GTEST_OS_ESP8266 || GTEST_OS_ESP32 || \ - GTEST_OS_XTENSA + GTEST_OS_XTENSA || GTEST_OS_QURT // These platforms do not have a current directory, so we just return // something reasonable. return FilePath(kCurrentDirectoryString); @@ -323,7 +323,7 @@ bool FilePath::CreateFolder() const { delete[] unicode; #elif GTEST_OS_WINDOWS int result = _mkdir(pathname_.c_str()); -#elif GTEST_OS_ESP8266 || GTEST_OS_XTENSA +#elif GTEST_OS_ESP8266 || GTEST_OS_XTENSA || GTEST_OS_QURT // do nothing int result = 0; #else diff --git a/googletest/src/gtest_main.cc b/googletest/src/gtest_main.cc index 4497637..d226048 100644 --- a/googletest/src/gtest_main.cc +++ b/googletest/src/gtest_main.cc @@ -32,9 +32,12 @@ #include "gtest/gtest.h" #if GTEST_OS_ESP8266 || GTEST_OS_ESP32 +// Aduino-like platforms: program entry points are setup/loop instead of main. + #if GTEST_OS_ESP8266 extern "C" { #endif + void setup() { testing::InitGoogleTest(); } void loop() { RUN_ALL_TESTS(); } @@ -43,7 +46,16 @@ void loop() { RUN_ALL_TESTS(); } } #endif +#elif GTEST_OS_QURT +// QuRT: program entry point is main, but argc/argv are unusable. + +GTEST_API_ int main() { + printf("Running main() from %s\n", __FILE__); + testing::InitGoogleTest(); + return RUN_ALL_TESTS(); +} #else +// Normal platforms: program entry point is main, argc/argv are initialized. GTEST_API_ int main(int argc, char **argv) { printf("Running main() from %s\n", __FILE__); |