Skip to content

Instantly share code, notes, and snippets.

@mht
Created January 21, 2014 06:36
Show Gist options
  • Save mht/8535353 to your computer and use it in GitHub Desktop.
Save mht/8535353 to your computer and use it in GitHub Desktop.
int _tmain(int argc, _TCHAR* argv[])
{
base::AtExitManager exit_manager;
CommandLine::Init(0, NULL);
base::FilePath log_dir;
PathService::Get(base::DIR_EXE, &log_dir);
base::FilePath log_file = log_dir.Append(kLogFile);
logging::LoggingSettings ls;
ls.logging_dest = logging::LOG_TO_ALL;
ls.log_file = log_file.value().c_str();
ls.lock_log = logging::DONT_LOCK_LOG_FILE;
ls.delete_old = logging::DELETE_OLD_LOG_FILE;
const bool succeeded = logging::InitLogging(ls);
CHECK(succeeded) << "Failed to initial logging system!";
testing::InitGoogleTest(&argc, argv);
const int rv = RUN_ALL_TESTS();
VLOG(1) << "RUN_ALL_TESTS() returns: " << rv;
return rv;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment