| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |