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 #ifndef VM_UNIT_TEST_H_ | 5 #ifndef VM_UNIT_TEST_H_ |
6 #define VM_UNIT_TEST_H_ | 6 #define VM_UNIT_TEST_H_ |
7 | 7 |
8 #include "include/dart_api.h" | 8 #include "include/dart_api.h" |
9 | 9 |
10 #include "vm/ast.h" | 10 #include "vm/ast.h" |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 }; | 163 }; |
164 | 164 |
165 | 165 |
166 class TestCase : TestCaseBase { | 166 class TestCase : TestCaseBase { |
167 public: | 167 public: |
168 typedef void (RunEntry)(); | 168 typedef void (RunEntry)(); |
169 | 169 |
170 TestCase(RunEntry* run, const char* name) : TestCaseBase(name), run_(run) { } | 170 TestCase(RunEntry* run, const char* name) : TestCaseBase(name), run_(run) { } |
171 | 171 |
172 static Dart_Handle LoadTestScript(const char* script, | 172 static Dart_Handle LoadTestScript(const char* script, |
173 Dart_NativeEntryResolver resolver) { | 173 Dart_NativeEntryResolver resolver); |
174 return LoadTestScript(script, resolver, Dart_NewList(0)); | |
175 } | |
176 static Dart_Handle LoadTestScript(const char* script, | |
177 Dart_NativeEntryResolver resolver, | |
178 Dart_Handle import_map); | |
179 static Dart_Handle lib(); | 174 static Dart_Handle lib(); |
180 static const char* url() { return "dart:test-lib"; } | 175 static const char* url() { return "dart:test-lib"; } |
181 static Dart_Isolate CreateTestIsolateFromSnapshot(uint8_t* buffer) { | 176 static Dart_Isolate CreateTestIsolateFromSnapshot(uint8_t* buffer) { |
182 return CreateIsolate(buffer); | 177 return CreateIsolate(buffer); |
183 } | 178 } |
184 static Dart_Isolate CreateTestIsolate() { | 179 static Dart_Isolate CreateTestIsolate() { |
185 return CreateIsolate(NULL); | 180 return CreateIsolate(NULL); |
186 } | 181 } |
187 static Dart_Handle library_handler(Dart_LibraryTag tag, | 182 static Dart_Handle library_handler(Dart_LibraryTag tag, |
188 Dart_Handle library, | 183 Dart_Handle library, |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 } else { \ | 304 } else { \ |
310 dart::Expect(__FILE__, __LINE__).Fail( \ | 305 dart::Expect(__FILE__, __LINE__).Fail( \ |
311 "expected '%s' to be an error handle but found a valid handle.\n", \ | 306 "expected '%s' to be an error handle but found a valid handle.\n", \ |
312 #handle); \ | 307 #handle); \ |
313 } \ | 308 } \ |
314 } while (0) | 309 } while (0) |
315 | 310 |
316 } // namespace dart | 311 } // namespace dart |
317 | 312 |
318 #endif // VM_UNIT_TEST_H_ | 313 #endif // VM_UNIT_TEST_H_ |
OLD | NEW |