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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 // Last argument is the test name, the rest are vm flags. | 90 // Last argument is the test name, the rest are vm flags. |
91 run_filter = argv[argc - 1]; | 91 run_filter = argv[argc - 1]; |
92 // Remove the first value (executable) from the arguments and | 92 // Remove the first value (executable) from the arguments and |
93 // exclude the last argument which is the test name. | 93 // exclude the last argument which is the test name. |
94 dart_argc = argc - 2; | 94 dart_argc = argc - 2; |
95 dart_argv = &argv[1]; | 95 dart_argv = &argv[1]; |
96 } | 96 } |
97 bool set_vm_flags_success = Flags::ProcessCommandLineFlags(dart_argc, | 97 bool set_vm_flags_success = Flags::ProcessCommandLineFlags(dart_argc, |
98 dart_argv); | 98 dart_argv); |
99 ASSERT(set_vm_flags_success); | 99 ASSERT(set_vm_flags_success); |
100 const char* err_msg = Dart::InitOnce(NULL, NULL, NULL, NULL, | 100 const char* err_msg = Dart::InitOnce(NULL, |
| 101 NULL, NULL, NULL, NULL, |
101 dart::bin::DartUtils::OpenFile, | 102 dart::bin::DartUtils::OpenFile, |
102 dart::bin::DartUtils::ReadFile, | 103 dart::bin::DartUtils::ReadFile, |
103 dart::bin::DartUtils::WriteFile, | 104 dart::bin::DartUtils::WriteFile, |
104 dart::bin::DartUtils::CloseFile, | 105 dart::bin::DartUtils::CloseFile, |
105 NULL); | 106 NULL); |
106 ASSERT(err_msg == NULL); | 107 ASSERT(err_msg == NULL); |
107 // Apply the filter to all registered tests. | 108 // Apply the filter to all registered tests. |
108 TestCaseBase::RunAll(); | 109 TestCaseBase::RunAll(); |
109 // Apply the filter to all registered benchmarks. | 110 // Apply the filter to all registered benchmarks. |
110 Benchmark::RunAll(argv[0]); | 111 Benchmark::RunAll(argv[0]); |
111 // Print a warning message if no tests or benchmarks were matched. | 112 // Print a warning message if no tests or benchmarks were matched. |
112 if (run_matches == 0) { | 113 if (run_matches == 0) { |
113 fprintf(stderr, "No tests matched: %s\n", run_filter); | 114 fprintf(stderr, "No tests matched: %s\n", run_filter); |
114 return 1; | 115 return 1; |
115 } | 116 } |
116 return 0; | 117 return 0; |
117 } | 118 } |
118 | 119 |
119 } // namespace dart | 120 } // namespace dart |
120 | 121 |
121 | 122 |
122 int main(int argc, const char** argv) { | 123 int main(int argc, const char** argv) { |
123 return dart::Main(argc, argv); | 124 return dart::Main(argc, argv); |
124 } | 125 } |
OLD | NEW |