Index: runtime/vm/unit_test.h |
diff --git a/runtime/vm/unit_test.h b/runtime/vm/unit_test.h |
index 945fd6e8378b88ed8045a6672439cfc73e770a68..e0077ddb41229b0a6c28428fb7210e4707f136c1 100644 |
--- a/runtime/vm/unit_test.h |
+++ b/runtime/vm/unit_test.h |
@@ -28,6 +28,14 @@ |
static const dart::TestCase kRegister##name(Dart_Test##name, #name); \ |
void Dart_Test##name() |
+// The RAW_UNIT_TEST_CASE macro is used for tests that do not require any of the |
+// functionality provided by the VM. Tests declared using this macro will be run |
+// before the VM is initialized. |
+#define RAW_UNIT_TEST_CASE(name) \ |
+ void Dart_Test##name(); \ |
+ static const dart::RawTestCase kRegister##name(Dart_Test##name, #name); \ |
+ void Dart_Test##name() |
+ |
// The VM_TEST_CASE macro is used for tests that need an isolate and zone |
// in order to test its functionality. This macro is used for tests that |
// are implemented using the VM code directly and do not use the Dart API |
@@ -261,6 +269,10 @@ class TestCaseBase { |
void RunTest(); |
static void RunAll(); |
+ static void RunAllRaw(); |
+ |
+ protected: |
+ bool raw_test_; |
private: |
static TestCaseBase* first_; |
@@ -323,6 +335,20 @@ class TestCase : TestCaseBase { |
}; |
+class RawTestCase : TestCaseBase { |
+ public: |
+ typedef void(RunEntry)(); |
+ |
+ RawTestCase(RunEntry* run, const char* name) : TestCaseBase(name), run_(run) { |
+ raw_test_ = true; |
+ } |
+ virtual void Run(); |
+ |
+ private: |
+ RunEntry* const run_; |
+}; |
+ |
+ |
class TestIsolateScope { |
public: |
TestIsolateScope() { |