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 RUNTIME_VM_UNIT_TEST_H_ | 5 #ifndef RUNTIME_VM_UNIT_TEST_H_ |
6 #define RUNTIME_VM_UNIT_TEST_H_ | 6 #define RUNTIME_VM_UNIT_TEST_H_ |
7 | 7 |
8 #include "include/dart_native_api.h" | 8 #include "include/dart_native_api.h" |
9 | 9 |
10 #include "platform/globals.h" | 10 #include "platform/globals.h" |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 static TestCaseBase* first_; | 268 static TestCaseBase* first_; |
269 static TestCaseBase* tail_; | 269 static TestCaseBase* tail_; |
270 | 270 |
271 TestCaseBase* next_; | 271 TestCaseBase* next_; |
272 const char* name_; | 272 const char* name_; |
273 | 273 |
274 DISALLOW_COPY_AND_ASSIGN(TestCaseBase); | 274 DISALLOW_COPY_AND_ASSIGN(TestCaseBase); |
275 }; | 275 }; |
276 | 276 |
277 #define USER_TEST_URI "test-lib" | 277 #define USER_TEST_URI "test-lib" |
| 278 #define RESOLVED_USER_TEST_URI "file:///test-lib" |
278 #define CORELIB_TEST_URI "dart:test-lib" | 279 #define CORELIB_TEST_URI "dart:test-lib" |
279 | 280 |
280 class TestCase : TestCaseBase { | 281 class TestCase : TestCaseBase { |
281 public: | 282 public: |
282 typedef void(RunEntry)(); | 283 typedef void(RunEntry)(); |
283 | 284 |
284 TestCase(RunEntry* run, const char* name) : TestCaseBase(name), run_(run) {} | 285 TestCase(RunEntry* run, const char* name) : TestCaseBase(name), run_(run) {} |
285 | 286 |
| 287 static char* CompileTestScriptWithDFE(const char* url, |
| 288 const char* source, |
| 289 void** kernel_pgm); |
286 static Dart_Handle LoadTestScript(const char* script, | 290 static Dart_Handle LoadTestScript(const char* script, |
287 Dart_NativeEntryResolver resolver, | 291 Dart_NativeEntryResolver resolver, |
288 const char* lib_uri = USER_TEST_URI, | 292 const char* lib_uri = USER_TEST_URI, |
289 bool finalize = true); | 293 bool finalize = true); |
290 static Dart_Handle LoadCoreTestScript(const char* script, | 294 static Dart_Handle LoadCoreTestScript(const char* script, |
291 Dart_NativeEntryResolver resolver); | 295 Dart_NativeEntryResolver resolver); |
292 static Dart_Handle lib(); | 296 static Dart_Handle lib(); |
293 static const char* url() { return USER_TEST_URI; } | 297 static const char* url(); |
294 static Dart_Isolate CreateTestIsolateFromSnapshot(uint8_t* buffer, | 298 static Dart_Isolate CreateTestIsolateFromSnapshot(uint8_t* buffer, |
295 const char* name = NULL) { | 299 const char* name = NULL) { |
296 return CreateIsolate(buffer, name); | 300 return CreateIsolate(buffer, name); |
297 } | 301 } |
298 static Dart_Isolate CreateTestIsolate(const char* name = NULL) { | 302 static Dart_Isolate CreateTestIsolate(const char* name = NULL) { |
299 return CreateIsolate(bin::core_isolate_snapshot_data, name); | 303 return CreateIsolate(bin::core_isolate_snapshot_data, name); |
300 } | 304 } |
301 static Dart_Handle library_handler(Dart_LibraryTag tag, | 305 static Dart_Handle library_handler(Dart_LibraryTag tag, |
302 Dart_Handle library, | 306 Dart_Handle library, |
303 Dart_Handle url); | 307 Dart_Handle url); |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 ~SetFlagScope() { *flag_ = original_value_; } | 626 ~SetFlagScope() { *flag_ = original_value_; } |
623 | 627 |
624 private: | 628 private: |
625 T* flag_; | 629 T* flag_; |
626 T original_value_; | 630 T original_value_; |
627 }; | 631 }; |
628 | 632 |
629 } // namespace dart | 633 } // namespace dart |
630 | 634 |
631 #endif // RUNTIME_VM_UNIT_TEST_H_ | 635 #endif // RUNTIME_VM_UNIT_TEST_H_ |
OLD | NEW |