OLD | NEW |
1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 16 matching lines...) Expand all Loading... |
27 | 27 |
28 #include "include/v8.h" | 28 #include "include/v8.h" |
29 #include "test/cctest/cctest.h" | 29 #include "test/cctest/cctest.h" |
30 | 30 |
31 #include "include/libplatform/libplatform.h" | 31 #include "include/libplatform/libplatform.h" |
32 #include "src/debug.h" | 32 #include "src/debug.h" |
33 #include "test/cctest/print-extension.h" | 33 #include "test/cctest/print-extension.h" |
34 #include "test/cctest/profiler-extension.h" | 34 #include "test/cctest/profiler-extension.h" |
35 #include "test/cctest/trace-extension.h" | 35 #include "test/cctest/trace-extension.h" |
36 | 36 |
| 37 #if (defined(_WIN32) || defined(_WIN64)) |
| 38 #include <windows.h> // NOLINT |
| 39 #endif |
| 40 |
37 enum InitializationState {kUnset, kUnintialized, kInitialized}; | 41 enum InitializationState {kUnset, kUnintialized, kInitialized}; |
38 static InitializationState initialization_state_ = kUnset; | 42 static InitializationState initialization_state_ = kUnset; |
39 static bool disable_automatic_dispose_ = false; | 43 static bool disable_automatic_dispose_ = false; |
40 | 44 |
41 CcTest* CcTest::last_ = NULL; | 45 CcTest* CcTest::last_ = NULL; |
42 bool CcTest::initialize_called_ = false; | 46 bool CcTest::initialize_called_ = false; |
43 bool CcTest::isolate_used_ = false; | 47 bool CcTest::isolate_used_ = false; |
44 v8::Isolate* CcTest::isolate_ = NULL; | 48 v8::Isolate* CcTest::isolate_ = NULL; |
45 | 49 |
46 | 50 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 | 135 |
132 | 136 |
133 static void SuggestTestHarness(int tests) { | 137 static void SuggestTestHarness(int tests) { |
134 if (tests == 0) return; | 138 if (tests == 0) return; |
135 printf("Running multiple tests in sequence is deprecated and may cause " | 139 printf("Running multiple tests in sequence is deprecated and may cause " |
136 "bogus failure. Consider using tools/run-tests.py instead.\n"); | 140 "bogus failure. Consider using tools/run-tests.py instead.\n"); |
137 } | 141 } |
138 | 142 |
139 | 143 |
140 int main(int argc, char* argv[]) { | 144 int main(int argc, char* argv[]) { |
| 145 #if (defined(_WIN32) || defined(_WIN64)) |
| 146 UINT new_flags = |
| 147 SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX | SEM_NOOPENFILEERRORBOX; |
| 148 UINT existing_flags = SetErrorMode(new_flags); |
| 149 SetErrorMode(existing_flags | new_flags); |
| 150 _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_DEBUG | _CRTDBG_MODE_FILE); |
| 151 _CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR); |
| 152 _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_DEBUG | _CRTDBG_MODE_FILE); |
| 153 _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR); |
| 154 _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_DEBUG | _CRTDBG_MODE_FILE); |
| 155 _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR); |
| 156 _set_error_mode(_OUT_TO_STDERR); |
| 157 #endif |
| 158 |
141 v8::V8::InitializeICU(); | 159 v8::V8::InitializeICU(); |
142 v8::Platform* platform = v8::platform::CreateDefaultPlatform(); | 160 v8::Platform* platform = v8::platform::CreateDefaultPlatform(); |
143 v8::V8::InitializePlatform(platform); | 161 v8::V8::InitializePlatform(platform); |
144 | 162 |
145 v8::internal::FlagList::SetFlagsFromCommandLine(&argc, argv, true); | 163 v8::internal::FlagList::SetFlagsFromCommandLine(&argc, argv, true); |
146 | 164 |
147 CcTestArrayBufferAllocator array_buffer_allocator; | 165 CcTestArrayBufferAllocator array_buffer_allocator; |
148 v8::V8::SetArrayBufferAllocator(&array_buffer_allocator); | 166 v8::V8::SetArrayBufferAllocator(&array_buffer_allocator); |
149 | 167 |
150 i::PrintExtension print_extension; | 168 i::PrintExtension print_extension; |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 CcTest::TearDown(); | 226 CcTest::TearDown(); |
209 // TODO(svenpanne) See comment above. | 227 // TODO(svenpanne) See comment above. |
210 // if (!disable_automatic_dispose_) v8::V8::Dispose(); | 228 // if (!disable_automatic_dispose_) v8::V8::Dispose(); |
211 v8::V8::ShutdownPlatform(); | 229 v8::V8::ShutdownPlatform(); |
212 delete platform; | 230 delete platform; |
213 return 0; | 231 return 0; |
214 } | 232 } |
215 | 233 |
216 RegisterThreadedTest *RegisterThreadedTest::first_ = NULL; | 234 RegisterThreadedTest *RegisterThreadedTest::first_ = NULL; |
217 int RegisterThreadedTest::count_ = 0; | 235 int RegisterThreadedTest::count_ = 0; |
OLD | NEW |