update parser (#5)

This commit is contained in:
tompzf
2026-01-16 11:40:02 +01:00
committed by GitHub
parent 5039a37131
commit 234be8917f
115 changed files with 14038 additions and 5380 deletions

View File

@@ -1,4 +1,5 @@
#include <gtest/gtest.h>
#include <cstring>
#include "../../../global/process_watchdog.h"
#if defined(_WIN32) && defined(_UNICODE)
@@ -7,8 +8,30 @@ extern "C" int wmain(int argc, wchar_t* argv[])
extern "C" int main(int argc, char* argv[])
#endif
{
CProcessWatchdog watchdog;
// Check for the --gtest_repeat option.
bool bRepeatEnabled = false;
for (int iIndex = 0; iIndex < argc; iIndex++)
{
if (!argv[iIndex])
continue;
#if defined(_WIN32) && defined(_UNICODE)
bRepeatEnabled |= std::wcsncmp(argv[iIndex], L"--gtest_repeat", 14) == 0;
#else
bRepeatEnabled |= std::strncmp(argv[iIndex], "--gtest_repeat", 14) == 0;
#endif
}
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
// When repeat is enabled, do not enable the watchdog.
if (bRepeatEnabled)
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
else
{
CProcessWatchdog watchdog;
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
}