| 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/platform.h" | 9 #include "bin/platform.h" |
| 10 #include "platform/assert.h" | 10 #include "platform/assert.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 OS::PrintErr("run_vm_tests [vm-flags ...] <test name>\n"); | 80 OS::PrintErr("run_vm_tests [vm-flags ...] <test name>\n"); |
| 81 OS::PrintErr("run_vm_tests [vm-flags ...] <benchmark name>\n"); | 81 OS::PrintErr("run_vm_tests [vm-flags ...] <benchmark name>\n"); |
| 82 } | 82 } |
| 83 | 83 |
| 84 | 84 |
| 85 static int Main(int argc, const char** argv) { | 85 static int Main(int argc, const char** argv) { |
| 86 // Flags being passed to the Dart VM. | 86 // Flags being passed to the Dart VM. |
| 87 int dart_argc = 0; | 87 int dart_argc = 0; |
| 88 const char** dart_argv = NULL; | 88 const char** dart_argv = NULL; |
| 89 | 89 |
| 90 // Perform platform specific initialization. |
| 91 if (!dart::bin::Platform::Initialize()) { |
| 92 OS::PrintErr("Initialization failed\n"); |
| 93 } |
| 94 |
| 90 if (argc < 2) { | 95 if (argc < 2) { |
| 91 // Bad parameter count. | 96 // Bad parameter count. |
| 92 PrintUsage(); | 97 PrintUsage(); |
| 93 return 1; | 98 return 1; |
| 94 } else if (argc == 2) { | 99 } else if (argc == 2) { |
| 95 if (strcmp(argv[1], "--list") == 0) { | 100 if (strcmp(argv[1], "--list") == 0) { |
| 96 run_filter = kList; | 101 run_filter = kList; |
| 97 // List all tests and benchmarks and exit without initializing the VM. | 102 // List all tests and benchmarks and exit without initializing the VM. |
| 98 TestCaseBase::RunAll(); | 103 TestCaseBase::RunAll(); |
| 99 Benchmark::RunAll(argv[0]); | 104 Benchmark::RunAll(argv[0]); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 } | 146 } |
| 142 return 0; | 147 return 0; |
| 143 } | 148 } |
| 144 | 149 |
| 145 } // namespace dart | 150 } // namespace dart |
| 146 | 151 |
| 147 | 152 |
| 148 int main(int argc, const char** argv) { | 153 int main(int argc, const char** argv) { |
| 149 dart::bin::Platform::Exit(dart::Main(argc, argv)); | 154 dart::bin::Platform::Exit(dart::Main(argc, argv)); |
| 150 } | 155 } |
| OLD | NEW |