OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include <stdio.h> | 5 #include <stdio.h> |
6 | 6 |
7 #include "bin/dartutils.h" | 7 #include "bin/dartutils.h" |
8 #include "bin/file.h" | 8 #include "bin/file.h" |
9 #include "bin/loader.h" | 9 #include "bin/loader.h" |
10 #include "bin/platform.h" | 10 #include "bin/platform.h" |
11 #include "bin/snapshot_utils.h" | 11 #include "bin/snapshot_utils.h" |
12 #include "platform/assert.h" | 12 #include "platform/assert.h" |
13 #include "vm/benchmark_test.h" | 13 #include "vm/benchmark_test.h" |
14 #include "vm/dart.h" | 14 #include "vm/dart.h" |
15 #include "vm/unit_test.h" | 15 #include "vm/unit_test.h" |
16 | 16 |
| 17 extern "C" { |
| 18 extern const uint8_t kDartVmSnapshotData[]; |
| 19 extern const uint8_t kDartVmSnapshotInstructions[]; |
| 20 extern const uint8_t kDartCoreIsolateSnapshotData[]; |
| 21 extern const uint8_t kDartCoreIsolateSnapshotInstructions[]; |
| 22 } |
17 | 23 |
18 // TODO(iposva, asiva): This is a placeholder for the real unittest framework. | 24 // TODO(iposva, asiva): This is a placeholder for the real unittest framework. |
19 namespace dart { | 25 namespace dart { |
20 | 26 |
21 // Defined in vm/os_thread_win.cc | 27 // Defined in vm/os_thread_win.cc |
22 extern bool private_flag_windows_run_tls_destructors; | 28 extern bool private_flag_windows_run_tls_destructors; |
23 | 29 |
24 // vm_snapshot_data_buffer points to a snapshot for the vm isolate if we | 30 // Snapshot pieces when we link in a snapshot. |
25 // link in a snapshot otherwise it is initialized to NULL. | 31 #if defined(DART_NO_SNAPSHOT) |
26 extern const uint8_t* bin::vm_snapshot_data; | 32 #error "run_vm_tests must be built with a snapshot" |
27 extern const uint8_t* bin::vm_snapshot_instructions; | 33 #else |
| 34 const uint8_t* bin::vm_snapshot_data = kDartVmSnapshotData; |
| 35 const uint8_t* bin::vm_snapshot_instructions = kDartVmSnapshotInstructions; |
| 36 const uint8_t* bin::core_isolate_snapshot_data = kDartCoreIsolateSnapshotData; |
| 37 const uint8_t* bin::core_isolate_snapshot_instructions = |
| 38 kDartCoreIsolateSnapshotInstructions; |
| 39 #endif |
28 | 40 |
29 // Only run tests that match the filter string. The default does not match any | 41 // Only run tests that match the filter string. The default does not match any |
30 // tests. | 42 // tests. |
31 static const char* const kNone = "No Test or Benchmarks"; | 43 static const char* const kNone = "No Test or Benchmarks"; |
32 static const char* const kList = "List all Tests and Benchmarks"; | 44 static const char* const kList = "List all Tests and Benchmarks"; |
33 static const char* const kAllBenchmarks = "All Benchmarks"; | 45 static const char* const kAllBenchmarks = "All Benchmarks"; |
34 static const char* run_filter = kNone; | 46 static const char* run_filter = kNone; |
35 static const char* kernel_snapshot = NULL; | 47 static const char* kernel_snapshot = NULL; |
36 | 48 |
37 static int run_matches = 0; | 49 static int run_matches = 0; |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 } | 267 } |
256 return 0; | 268 return 0; |
257 } | 269 } |
258 | 270 |
259 } // namespace dart | 271 } // namespace dart |
260 | 272 |
261 | 273 |
262 int main(int argc, const char** argv) { | 274 int main(int argc, const char** argv) { |
263 dart::bin::Platform::Exit(dart::Main(argc, argv)); | 275 dart::bin::Platform::Exit(dart::Main(argc, argv)); |
264 } | 276 } |
OLD | NEW |