9#include "flutter/fml/backtrace.h"
10#include "flutter/fml/build_config.h"
11#include "flutter/fml/command_line.h"
12#include "flutter/testing/debugger_detection.h"
13#include "flutter/testing/test_args.h"
14#include "flutter/testing/test_timeout_listener.h"
15#include "gtest/gtest.h"
24 std::string timeout_seconds;
25 if (!command_line.GetOptionValue(
"timeout", &timeout_seconds)) {
30 const auto seconds =
std::stoi(timeout_seconds);
45 asl_log_descriptor(NULL, NULL, ASL_LEVEL_NOTICE, STDOUT_FILENO,
46 ASL_LOG_DESCRIPTOR_WRITE);
47 asl_log_descriptor(NULL, NULL, ASL_LEVEL_ERR, STDERR_FILENO,
48 ASL_LOG_DESCRIPTOR_WRITE);
51 ::testing::InitGoogleTest(&argc,
argv);
52 GTEST_FLAG_SET(death_test_style,
"threadsafe");
57 FML_LOG(INFO) <<
"Timeouts disabled via a command line flag.";
58 return RUN_ALL_TESTS();
64 FML_LOG(INFO) <<
"Debugger is attached. Suspending test timeouts.";
65 return RUN_ALL_TESTS();
68 auto timeout_listener =
70 auto& listeners = ::testing::UnitTest::GetInstance()->listeners();
71 listeners.Append(timeout_listener);
72 auto result = RUN_ALL_TESTS();
73 delete listeners.Release(timeout_listener);
static constexpr TimeDelta FromSeconds(int64_t seconds)
#define FML_LOG(severity)
bool stoi(std::string_view s, SKSL_INT *value)
const fml::CommandLine & GetArgsForProcess()
DebuggerStatus GetDebuggerStatus()
void SetArgsForProcess(int argc, char **argv)
void InstallCrashHandler()
def timeout(deadline, cmd)
int main(int argc, char **argv)
std::optional< fml::TimeDelta > GetTestTimeout()