| 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 "vm/benchmark_test.h" | 7 #include "vm/benchmark_test.h" |
| 8 #include "vm/dart.h" | 8 #include "vm/dart.h" |
| 9 #include "vm/unit_test.h" | 9 #include "vm/unit_test.h" |
| 10 | 10 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 } else { | 93 } else { |
| 94 // First argument is the test name, the rest are vm flags. | 94 // First argument is the test name, the rest are vm flags. |
| 95 run_filter = argv[1]; | 95 run_filter = argv[1]; |
| 96 // Remove the first two values from the arguments. | 96 // Remove the first two values from the arguments. |
| 97 dart_argc = argc - 2; | 97 dart_argc = argc - 2; |
| 98 dart_argv = &argv[2]; | 98 dart_argv = &argv[2]; |
| 99 } | 99 } |
| 100 bool set_vm_flags_success = Flags::ProcessCommandLineFlags(dart_argc, | 100 bool set_vm_flags_success = Flags::ProcessCommandLineFlags(dart_argc, |
| 101 dart_argv); | 101 dart_argv); |
| 102 ASSERT(set_vm_flags_success); | 102 ASSERT(set_vm_flags_success); |
| 103 bool init_success = Dart::InitOnce(NULL, NULL); | 103 bool init_success = Dart::InitOnce(NULL, NULL, NULL); |
| 104 ASSERT(init_success); | 104 ASSERT(init_success); |
| 105 // Apply the filter to all registered tests. | 105 // Apply the filter to all registered tests. |
| 106 TestCaseBase::RunAll(); | 106 TestCaseBase::RunAll(); |
| 107 // Apply the filter to all registered benchmarks. | 107 // Apply the filter to all registered benchmarks. |
| 108 Benchmark::RunAll(argv[0]); | 108 Benchmark::RunAll(argv[0]); |
| 109 // Print a warning message if no tests or benchmarks were matched. | 109 // Print a warning message if no tests or benchmarks were matched. |
| 110 if (run_matches == 0) { | 110 if (run_matches == 0) { |
| 111 fprintf(stderr, "No tests matched: %s\n", run_filter); | 111 fprintf(stderr, "No tests matched: %s\n", run_filter); |
| 112 return 1; | 112 return 1; |
| 113 } | 113 } |
| 114 return 0; | 114 return 0; |
| 115 } | 115 } |
| 116 | 116 |
| 117 } // namespace dart | 117 } // namespace dart |
| 118 | 118 |
| 119 | 119 |
| 120 int main(int argc, const char** argv) { | 120 int main(int argc, const char** argv) { |
| 121 return dart::Main(argc, argv); | 121 return dart::Main(argc, argv); |
| 122 } | 122 } |
| OLD | NEW |