OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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/dart.h" | 7 #include "vm/dart.h" |
8 #include "vm/unit_test.h" | 8 #include "vm/unit_test.h" |
9 | 9 |
10 // TODO(iposva, asiva): This is a placeholder for the real unittest framework. | 10 // TODO(iposva, asiva): This is a placeholder for the real unittest framework. |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 } else { | 64 } else { |
65 test_filter = argv[1]; | 65 test_filter = argv[1]; |
66 } | 66 } |
67 } else { | 67 } else { |
68 // First argument is the test name, the rest are vm flags. | 68 // First argument is the test name, the rest are vm flags. |
69 test_filter = argv[1]; | 69 test_filter = argv[1]; |
70 // Remove the first two values from the arguments. | 70 // Remove the first two values from the arguments. |
71 dart_argc = argc - 2; | 71 dart_argc = argc - 2; |
72 dart_argv = &argv[2]; | 72 dart_argv = &argv[2]; |
73 } | 73 } |
74 bool set_vm_flags_success = Flags::ProcessCommandLineFlags(dart_argc, dart_arg
v); | 74 bool set_vm_flags_success = Flags::ProcessCommandLineFlags(dart_argc, |
| 75 dart_argv); |
75 ASSERT(set_vm_flags_success); | 76 ASSERT(set_vm_flags_success); |
76 bool init_success = Dart::InitOnce(NULL); | 77 bool init_success = Dart::InitOnce(NULL, NULL); |
77 ASSERT(init_success); | 78 ASSERT(init_success); |
78 // Apply the test filter to all registered tests. | 79 // Apply the test filter to all registered tests. |
79 TestCaseBase::RunAll(); | 80 TestCaseBase::RunAll(); |
80 // Print a warning message if no tests were matched. | 81 // Print a warning message if no tests were matched. |
81 if (test_matches == 0) { | 82 if (test_matches == 0) { |
82 fprintf(stderr, "No tests matched: %s\n", test_filter); | 83 fprintf(stderr, "No tests matched: %s\n", test_filter); |
83 return 1; | 84 return 1; |
84 } | 85 } |
85 return 0; | 86 return 0; |
86 } | 87 } |
87 | 88 |
88 } // namespace dart | 89 } // namespace dart |
89 | 90 |
90 | 91 |
91 int main(int argc, const char** argv) { | 92 int main(int argc, const char** argv) { |
92 return dart::Main(argc, argv); | 93 return dart::Main(argc, argv); |
93 } | 94 } |
OLD | NEW |