| 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/file.h" | 7 #include "bin/file.h" |
| 8 | 8 |
| 9 #include "vm/benchmark_test.h" | 9 #include "vm/benchmark_test.h" |
| 10 #include "vm/dart.h" | 10 #include "vm/dart.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 dart_argv = &argv[1]; | 103 dart_argv = &argv[1]; |
| 104 } | 104 } |
| 105 bool set_vm_flags_success = Flags::ProcessCommandLineFlags(dart_argc, | 105 bool set_vm_flags_success = Flags::ProcessCommandLineFlags(dart_argc, |
| 106 dart_argv); | 106 dart_argv); |
| 107 ASSERT(set_vm_flags_success); | 107 ASSERT(set_vm_flags_success); |
| 108 const char* err_msg = Dart::InitOnce(NULL, NULL, NULL, NULL, | 108 const char* err_msg = Dart::InitOnce(NULL, NULL, NULL, NULL, |
| 109 dart::bin::DartUtils::OpenFile, | 109 dart::bin::DartUtils::OpenFile, |
| 110 dart::bin::DartUtils::ReadFile, | 110 dart::bin::DartUtils::ReadFile, |
| 111 dart::bin::DartUtils::WriteFile, | 111 dart::bin::DartUtils::WriteFile, |
| 112 dart::bin::DartUtils::CloseFile, | 112 dart::bin::DartUtils::CloseFile, |
| 113 NULL, |
| 113 NULL); | 114 NULL); |
| 114 ASSERT(err_msg == NULL); | 115 ASSERT(err_msg == NULL); |
| 115 // Apply the filter to all registered tests. | 116 // Apply the filter to all registered tests. |
| 116 TestCaseBase::RunAll(); | 117 TestCaseBase::RunAll(); |
| 117 // Apply the filter to all registered benchmarks. | 118 // Apply the filter to all registered benchmarks. |
| 118 Benchmark::RunAll(argv[0]); | 119 Benchmark::RunAll(argv[0]); |
| 119 // Print a warning message if no tests or benchmarks were matched. | 120 // Print a warning message if no tests or benchmarks were matched. |
| 120 if (run_matches == 0) { | 121 if (run_matches == 0) { |
| 121 fprintf(stderr, "No tests matched: %s\n", run_filter); | 122 fprintf(stderr, "No tests matched: %s\n", run_filter); |
| 122 return 1; | 123 return 1; |
| 123 } | 124 } |
| 124 return 0; | 125 return 0; |
| 125 } | 126 } |
| 126 | 127 |
| 127 } // namespace dart | 128 } // namespace dart |
| 128 | 129 |
| 129 | 130 |
| 130 int main(int argc, const char** argv) { | 131 int main(int argc, const char** argv) { |
| 131 return dart::Main(argc, argv); | 132 return dart::Main(argc, argv); |
| 132 } | 133 } |
| OLD | NEW |