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

Side by Side Diff: runtime/vm/unit_test.cc

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: Fixed name of UNIT_TEST_CASE macro Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « runtime/vm/unit_test.h ('k') | runtime/vm/utils_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 #include "vm/unit_test.h" 5 #include "vm/unit_test.h"
6 6
7 #include <stdio.h> 7 #include <stdio.h>
8 8
9 #include "bin/builtin.h" 9 #include "bin/builtin.h"
10 #include "bin/dartutils.h" 10 #include "bin/dartutils.h"
(...skipping 14 matching lines...) Expand all
25 25
26 using dart::bin::Builtin; 26 using dart::bin::Builtin;
27 using dart::bin::DartUtils; 27 using dart::bin::DartUtils;
28 28
29 namespace dart { 29 namespace dart {
30 30
31 TestCaseBase* TestCaseBase::first_ = NULL; 31 TestCaseBase* TestCaseBase::first_ = NULL;
32 TestCaseBase* TestCaseBase::tail_ = NULL; 32 TestCaseBase* TestCaseBase::tail_ = NULL;
33 33
34 34
35 TestCaseBase::TestCaseBase(const char* name) : next_(NULL), name_(name) { 35 TestCaseBase::TestCaseBase(const char* name)
36 : raw_test_(false), next_(NULL), name_(name) {
36 if (first_ == NULL) { 37 if (first_ == NULL) {
37 first_ = this; 38 first_ = this;
38 } else { 39 } else {
39 tail_->next_ = this; 40 tail_->next_ = this;
40 } 41 }
41 tail_ = this; 42 tail_ = this;
42 } 43 }
43 44
44 45
46 void TestCaseBase::RunAllRaw() {
47 TestCaseBase* test = first_;
48 while (test != NULL) {
49 if (test->raw_test_) {
50 test->RunTest();
51 }
52 test = test->next_;
53 }
54 }
55
56
45 void TestCaseBase::RunAll() { 57 void TestCaseBase::RunAll() {
46 TestCaseBase* test = first_; 58 TestCaseBase* test = first_;
47 while (test != NULL) { 59 while (test != NULL) {
48 test->RunTest(); 60 if (!test->raw_test_) {
61 test->RunTest();
62 }
49 test = test->next_; 63 test = test->next_;
50 } 64 }
51 } 65 }
52 66
53 67
54 Dart_Isolate TestCase::CreateIsolate(const uint8_t* buffer, const char* name) { 68 Dart_Isolate TestCase::CreateIsolate(const uint8_t* buffer, const char* name) {
55 char* err; 69 char* err;
56 Dart_Isolate isolate = 70 Dart_Isolate isolate =
57 Dart_CreateIsolate(name, NULL, buffer, NULL, NULL, NULL, &err); 71 Dart_CreateIsolate(name, NULL, buffer, NULL, NULL, NULL, &err);
58 if (isolate == NULL) { 72 if (isolate == NULL) {
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 } 493 }
480 // Copy the remainder of in to out. 494 // Copy the remainder of in to out.
481 while (*in != '\0') { 495 while (*in != '\0') {
482 *out++ = *in++; 496 *out++ = *in++;
483 } 497 }
484 *out = '\0'; 498 *out = '\0';
485 } 499 }
486 500
487 501
488 } // namespace dart 502 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/unit_test.h ('k') | runtime/vm/utils_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698