| 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 // Remove the first value (executable) from the arguments and | 116 // Remove the first value (executable) from the arguments and |
| 117 // exclude the last argument which is the test name. | 117 // exclude the last argument which is the test name. |
| 118 dart_argc = argc - 2; | 118 dart_argc = argc - 2; |
| 119 dart_argv = &argv[1]; | 119 dart_argv = &argv[1]; |
| 120 } | 120 } |
| 121 bool set_vm_flags_success = | 121 bool set_vm_flags_success = |
| 122 Flags::ProcessCommandLineFlags(dart_argc, dart_argv); | 122 Flags::ProcessCommandLineFlags(dart_argc, dart_argv); |
| 123 ASSERT(set_vm_flags_success); | 123 ASSERT(set_vm_flags_success); |
| 124 const char* err_msg = Dart::InitOnce( | 124 const char* err_msg = Dart::InitOnce( |
| 125 dart::bin::vm_snapshot_data, dart::bin::vm_snapshot_instructions, NULL, | 125 dart::bin::vm_snapshot_data, dart::bin::vm_snapshot_instructions, NULL, |
| 126 NULL, NULL, dart::bin::DartUtils::OpenFile, | 126 NULL, NULL, NULL, dart::bin::DartUtils::OpenFile, |
| 127 dart::bin::DartUtils::ReadFile, dart::bin::DartUtils::WriteFile, | 127 dart::bin::DartUtils::ReadFile, dart::bin::DartUtils::WriteFile, |
| 128 dart::bin::DartUtils::CloseFile, NULL, NULL); | 128 dart::bin::DartUtils::CloseFile, NULL, NULL); |
| 129 ASSERT(err_msg == NULL); | 129 ASSERT(err_msg == NULL); |
| 130 // Apply the filter to all registered tests. | 130 // Apply the filter to all registered tests. |
| 131 TestCaseBase::RunAll(); | 131 TestCaseBase::RunAll(); |
| 132 // Apply the filter to all registered benchmarks. | 132 // Apply the filter to all registered benchmarks. |
| 133 Benchmark::RunAll(argv[0]); | 133 Benchmark::RunAll(argv[0]); |
| 134 | 134 |
| 135 err_msg = Dart::Cleanup(); | 135 err_msg = Dart::Cleanup(); |
| 136 ASSERT(err_msg == NULL); | 136 ASSERT(err_msg == NULL); |
| 137 | 137 |
| 138 TestCaseBase::RunAllRaw(); | 138 TestCaseBase::RunAllRaw(); |
| 139 // Print a warning message if no tests or benchmarks were matched. | 139 // Print a warning message if no tests or benchmarks were matched. |
| 140 if (run_matches == 0) { | 140 if (run_matches == 0) { |
| 141 OS::PrintErr("No tests matched: %s\n", run_filter); | 141 OS::PrintErr("No tests matched: %s\n", run_filter); |
| 142 return 1; | 142 return 1; |
| 143 } | 143 } |
| 144 if (DynamicAssertionHelper::failed()) { | 144 if (DynamicAssertionHelper::failed()) { |
| 145 return 255; | 145 return 255; |
| 146 } | 146 } |
| 147 return 0; | 147 return 0; |
| 148 } | 148 } |
| 149 | 149 |
| 150 } // namespace dart | 150 } // namespace dart |
| 151 | 151 |
| 152 | 152 |
| 153 int main(int argc, const char** argv) { | 153 int main(int argc, const char** argv) { |
| 154 dart::bin::Platform::Exit(dart::Main(argc, argv)); | 154 dart::bin::Platform::Exit(dart::Main(argc, argv)); |
| 155 } | 155 } |
| OLD | NEW |