Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(582)

Unified Diff: runtime/vm/unit_test.h

Issue 2666133002: Added new type of unit test, RAW_UNIT_TEST_CASE, which is used for tests that can be flaky if run w… (Closed)
Patch Set: Updated comment in test file. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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() {

Powered by Google App Engine
This is Rietveld 408576698