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