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 #include "bin/dartutils.h" | |
9 #include "bin/platform.h" | |
8 | 10 |
9 #include "vm/benchmark_test.h" | 11 #include "vm/benchmark_test.h" |
10 #include "vm/dart.h" | 12 #include "vm/dart.h" |
11 #include "bin/dartutils.h" | |
12 #include "vm/unit_test.h" | 13 #include "vm/unit_test.h" |
13 | 14 |
14 | 15 |
15 // TODO(iposva, asiva): This is a placeholder for the real unittest framework. | 16 // TODO(iposva, asiva): This is a placeholder for the real unittest framework. |
16 namespace dart { | 17 namespace dart { |
17 | 18 |
19 // Defined in vm/os_thread_win.cc | |
20 extern bool private_flag_windows_run_tls_destructors; | |
21 | |
18 // vm_isolate_snapshot_buffer points to a snapshot for the vm isolate if we | 22 // vm_isolate_snapshot_buffer points to a snapshot for the vm isolate if we |
19 // link in a snapshot otherwise it is initialized to NULL. | 23 // link in a snapshot otherwise it is initialized to NULL. |
20 extern const uint8_t* bin::vm_isolate_snapshot_buffer; | 24 extern const uint8_t* bin::vm_isolate_snapshot_buffer; |
21 | 25 |
22 // Only run tests that match the filter string. The default does not match any | 26 // Only run tests that match the filter string. The default does not match any |
23 // tests. | 27 // tests. |
24 static const char* const kNone = "No Test or Benchmarks"; | 28 static const char* const kNone = "No Test or Benchmarks"; |
25 static const char* const kList = "List all Tests and Benchmarks"; | 29 static const char* const kList = "List all Tests and Benchmarks"; |
26 static const char* const kAllBenchmarks = "All Benchmarks"; | 30 static const char* const kAllBenchmarks = "All Benchmarks"; |
27 static const char* run_filter = kNone; | 31 static const char* run_filter = kNone; |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
114 // Apply the filter to all registered tests. | 118 // Apply the filter to all registered tests. |
115 TestCaseBase::RunAll(); | 119 TestCaseBase::RunAll(); |
116 // Apply the filter to all registered benchmarks. | 120 // Apply the filter to all registered benchmarks. |
117 Benchmark::RunAll(argv[0]); | 121 Benchmark::RunAll(argv[0]); |
118 | 122 |
119 if (Flags::IsSet("shutdown")) { | 123 if (Flags::IsSet("shutdown")) { |
120 err_msg = Dart::Cleanup(); | 124 err_msg = Dart::Cleanup(); |
121 ASSERT(err_msg == NULL); | 125 ASSERT(err_msg == NULL); |
122 } | 126 } |
123 | 127 |
128 // TODO(zra): Remove once VM shuts down cleanly. | |
129 private_flag_windows_run_tls_destructors = false; | |
zra
2015/11/04 15:04:44
Oh, I guess this needs an #if defined(TARGET_OS_WI
| |
130 | |
124 // Print a warning message if no tests or benchmarks were matched. | 131 // Print a warning message if no tests or benchmarks were matched. |
125 if (run_matches == 0) { | 132 if (run_matches == 0) { |
126 fprintf(stderr, "No tests matched: %s\n", run_filter); | 133 fprintf(stderr, "No tests matched: %s\n", run_filter); |
127 return 1; | 134 return 1; |
128 } | 135 } |
129 return 0; | 136 return 0; |
130 } | 137 } |
131 | 138 |
132 } // namespace dart | 139 } // namespace dart |
133 | 140 |
134 | 141 |
135 int main(int argc, const char** argv) { | 142 int main(int argc, const char** argv) { |
136 return dart::Main(argc, argv); | 143 return dart::Main(argc, argv); |
137 } | 144 } |
OLD | NEW |