| 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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 | 235 |
| 236 namespace dart { | 236 namespace dart { |
| 237 | 237 |
| 238 // Forward declarations. | 238 // Forward declarations. |
| 239 class Assembler; | 239 class Assembler; |
| 240 class CodeGenerator; | 240 class CodeGenerator; |
| 241 class VirtualMemory; | 241 class VirtualMemory; |
| 242 | 242 |
| 243 | 243 |
| 244 namespace bin { | 244 namespace bin { |
| 245 // vm_isolate_snapshot_buffer points to a snapshot for the vm isolate if we | 245 // Snapshot pieces if we link in a snapshot, otherwise initialized to NULL. |
| 246 // link in a snapshot otherwise it is initialized to NULL. | 246 extern const uint8_t* vm_snapshot_data; |
| 247 extern const uint8_t* vm_isolate_snapshot_buffer; | 247 extern const uint8_t* vm_snapshot_instructions; |
| 248 | 248 extern const uint8_t* core_isolate_snapshot_data; |
| 249 // isolate_snapshot_buffer points to a snapshot for an isolate if we link in a | 249 extern const uint8_t* core_isolate_snapshot_instructions; |
| 250 // snapshot otherwise it is initialized to NULL. | |
| 251 extern const uint8_t* core_isolate_snapshot_buffer; | |
| 252 } | 250 } |
| 253 | 251 |
| 254 | 252 |
| 255 class TestCaseBase { | 253 class TestCaseBase { |
| 256 public: | 254 public: |
| 257 explicit TestCaseBase(const char* name); | 255 explicit TestCaseBase(const char* name); |
| 258 virtual ~TestCaseBase() {} | 256 virtual ~TestCaseBase() {} |
| 259 | 257 |
| 260 const char* name() const { return name_; } | 258 const char* name() const { return name_; } |
| 261 | 259 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 289 bool finalize = true); | 287 bool finalize = true); |
| 290 static Dart_Handle LoadCoreTestScript(const char* script, | 288 static Dart_Handle LoadCoreTestScript(const char* script, |
| 291 Dart_NativeEntryResolver resolver); | 289 Dart_NativeEntryResolver resolver); |
| 292 static Dart_Handle lib(); | 290 static Dart_Handle lib(); |
| 293 static const char* url() { return USER_TEST_URI; } | 291 static const char* url() { return USER_TEST_URI; } |
| 294 static Dart_Isolate CreateTestIsolateFromSnapshot(uint8_t* buffer, | 292 static Dart_Isolate CreateTestIsolateFromSnapshot(uint8_t* buffer, |
| 295 const char* name = NULL) { | 293 const char* name = NULL) { |
| 296 return CreateIsolate(buffer, name); | 294 return CreateIsolate(buffer, name); |
| 297 } | 295 } |
| 298 static Dart_Isolate CreateTestIsolate(const char* name = NULL) { | 296 static Dart_Isolate CreateTestIsolate(const char* name = NULL) { |
| 299 return CreateIsolate(bin::core_isolate_snapshot_buffer, name); | 297 return CreateIsolate(bin::core_isolate_snapshot_data, name); |
| 300 } | 298 } |
| 301 static Dart_Handle library_handler(Dart_LibraryTag tag, | 299 static Dart_Handle library_handler(Dart_LibraryTag tag, |
| 302 Dart_Handle library, | 300 Dart_Handle library, |
| 303 Dart_Handle url); | 301 Dart_Handle url); |
| 304 static char* BigintToHexValue(Dart_CObject* bigint); | 302 static char* BigintToHexValue(Dart_CObject* bigint); |
| 305 | 303 |
| 306 virtual void Run(); | 304 virtual void Run(); |
| 307 | 305 |
| 308 // Sets |script| to be the source used at next reload. | 306 // Sets |script| to be the source used at next reload. |
| 309 static void SetReloadTestScript(const char* script); | 307 static void SetReloadTestScript(const char* script); |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 616 ~SetFlagScope() { *flag_ = original_value_; } | 614 ~SetFlagScope() { *flag_ = original_value_; } |
| 617 | 615 |
| 618 private: | 616 private: |
| 619 T* flag_; | 617 T* flag_; |
| 620 T original_value_; | 618 T original_value_; |
| 621 }; | 619 }; |
| 622 | 620 |
| 623 } // namespace dart | 621 } // namespace dart |
| 624 | 622 |
| 625 #endif // RUNTIME_VM_UNIT_TEST_H_ | 623 #endif // RUNTIME_VM_UNIT_TEST_H_ |
| OLD | NEW |