OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2007 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2007 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 // | 10 // |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 #endif | 86 #endif |
87 #endif // WEBRTC_WIN | 87 #endif // WEBRTC_WIN |
88 | 88 |
89 rtc::Filesystem::SetOrganizationName("google"); | 89 rtc::Filesystem::SetOrganizationName("google"); |
90 rtc::Filesystem::SetApplicationName("unittest"); | 90 rtc::Filesystem::SetApplicationName("unittest"); |
91 | 91 |
92 // By default, log timestamps. Allow overrides by used of a --log flag. | 92 // By default, log timestamps. Allow overrides by used of a --log flag. |
93 rtc::LogMessage::LogTimestamps(); | 93 rtc::LogMessage::LogTimestamps(); |
94 if (*FLAG_log != '\0') { | 94 if (*FLAG_log != '\0') { |
95 rtc::LogMessage::ConfigureLogging(FLAG_log); | 95 rtc::LogMessage::ConfigureLogging(FLAG_log); |
| 96 } else if (rtc::LogMessage::GetLogToDebug() > rtc::LS_INFO) { |
| 97 // Default to LS_INFO, even for release builds to provide better test |
| 98 // logging. |
| 99 rtc::LogMessage::LogToDebug(rtc::LS_INFO); |
96 } | 100 } |
97 | 101 |
98 // Initialize SSL which are used by several tests. | 102 // Initialize SSL which are used by several tests. |
99 rtc::InitializeSSL(); | 103 rtc::InitializeSSL(); |
100 | 104 |
101 int res = RUN_ALL_TESTS(); | 105 int res = RUN_ALL_TESTS(); |
102 | 106 |
103 rtc::CleanupSSL(); | 107 rtc::CleanupSSL(); |
104 | 108 |
105 // clean up logging so we don't appear to leak memory. | 109 // clean up logging so we don't appear to leak memory. |
106 rtc::LogMessage::ConfigureLogging(""); | 110 rtc::LogMessage::ConfigureLogging(""); |
107 | 111 |
108 #if defined(WEBRTC_WIN) | 112 #if defined(WEBRTC_WIN) |
109 // Unhook crt function so that we don't ever log after statics have been | 113 // Unhook crt function so that we don't ever log after statics have been |
110 // uninitialized. | 114 // uninitialized. |
111 if (!FLAG_default_error_handlers) | 115 if (!FLAG_default_error_handlers) |
112 _CrtSetReportHook2(_CRT_RPTHOOK_REMOVE, TestCrtReportHandler); | 116 _CrtSetReportHook2(_CRT_RPTHOOK_REMOVE, TestCrtReportHandler); |
113 #endif | 117 #endif |
114 | 118 |
115 return res; | 119 return res; |
116 } | 120 } |
OLD | NEW |