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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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, NULL, NULL, NULL, |
101 dart::bin::DartUtils::OpenFile, | 101 dart::bin::DartUtils::OpenFile, |
102 dart::bin::DartUtils::ReadFile, | 102 dart::bin::DartUtils::ReadFile, |
103 dart::bin::DartUtils::WriteFile, | 103 dart::bin::DartUtils::WriteFile, |
104 dart::bin::DartUtils::CloseFile, | 104 dart::bin::DartUtils::CloseFile, |
105 NULL, | |
106 NULL); | 105 NULL); |
107 ASSERT(err_msg == NULL); | 106 ASSERT(err_msg == NULL); |
108 // Apply the filter to all registered tests. | 107 // Apply the filter to all registered tests. |
109 TestCaseBase::RunAll(); | 108 TestCaseBase::RunAll(); |
110 // Apply the filter to all registered benchmarks. | 109 // Apply the filter to all registered benchmarks. |
111 Benchmark::RunAll(argv[0]); | 110 Benchmark::RunAll(argv[0]); |
112 // Print a warning message if no tests or benchmarks were matched. | 111 // Print a warning message if no tests or benchmarks were matched. |
113 if (run_matches == 0) { | 112 if (run_matches == 0) { |
114 fprintf(stderr, "No tests matched: %s\n", run_filter); | 113 fprintf(stderr, "No tests matched: %s\n", run_filter); |
115 return 1; | 114 return 1; |
116 } | 115 } |
117 return 0; | 116 return 0; |
118 } | 117 } |
119 | 118 |
120 } // namespace dart | 119 } // namespace dart |
121 | 120 |
122 | 121 |
123 int main(int argc, const char** argv) { | 122 int main(int argc, const char** argv) { |
124 return dart::Main(argc, argv); | 123 return dart::Main(argc, argv); |
125 } | 124 } |
OLD | NEW |