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 10 matching lines...) Expand all Loading... |
21 #include "vm/parser.h" | 21 #include "vm/parser.h" |
22 #include "vm/symbols.h" | 22 #include "vm/symbols.h" |
23 #include "vm/thread.h" | 23 #include "vm/thread.h" |
24 #include "vm/virtual_memory.h" | 24 #include "vm/virtual_memory.h" |
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 DECLARE_FLAG(bool, use_dart_frontend); | 31 DEFINE_FLAG(bool, |
| 32 use_dart_frontend, |
| 33 false, |
| 34 "Parse scripts with Dart-to-Kernel parser"); |
32 | 35 |
33 TestCaseBase* TestCaseBase::first_ = NULL; | 36 TestCaseBase* TestCaseBase::first_ = NULL; |
34 TestCaseBase* TestCaseBase::tail_ = NULL; | 37 TestCaseBase* TestCaseBase::tail_ = NULL; |
35 | 38 |
36 TestCaseBase::TestCaseBase(const char* name) | 39 TestCaseBase::TestCaseBase(const char* name) |
37 : raw_test_(false), next_(NULL), name_(name) { | 40 : raw_test_(false), next_(NULL), name_(name) { |
38 if (first_ == NULL) { | 41 if (first_ == NULL) { |
39 first_ = this; | 42 first_ = this; |
40 } else { | 43 } else { |
41 tail_->next_ = this; | 44 tail_->next_ = this; |
(...skipping 16 matching lines...) Expand all Loading... |
58 while (test != NULL) { | 61 while (test != NULL) { |
59 if (!test->raw_test_) { | 62 if (!test->raw_test_) { |
60 test->RunTest(); | 63 test->RunTest(); |
61 } | 64 } |
62 test = test->next_; | 65 test = test->next_; |
63 } | 66 } |
64 } | 67 } |
65 | 68 |
66 Dart_Isolate TestCase::CreateIsolate(const uint8_t* buffer, const char* name) { | 69 Dart_Isolate TestCase::CreateIsolate(const uint8_t* buffer, const char* name) { |
67 char* err; | 70 char* err; |
| 71 Dart_IsolateFlags api_flags; |
| 72 Isolate::FlagsInitialize(&api_flags); |
| 73 api_flags.use_dart_frontend = FLAG_use_dart_frontend; |
68 Dart_Isolate isolate = | 74 Dart_Isolate isolate = |
69 Dart_CreateIsolate(name, NULL, buffer, NULL, NULL, NULL, &err); | 75 Dart_CreateIsolate(name, NULL, buffer, NULL, &api_flags, NULL, &err); |
70 if (isolate == NULL) { | 76 if (isolate == NULL) { |
71 OS::Print("Creation of isolate failed '%s'\n", err); | 77 OS::Print("Creation of isolate failed '%s'\n", err); |
72 free(err); | 78 free(err); |
73 } | 79 } |
74 EXPECT(isolate != NULL); | 80 EXPECT(isolate != NULL); |
75 return isolate; | 81 return isolate; |
76 } | 82 } |
77 | 83 |
78 static const char* kPackageScheme = "package:"; | 84 static const char* kPackageScheme = "package:"; |
79 | 85 |
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 pos = strstr(in, prefix); | 566 pos = strstr(in, prefix); |
561 } | 567 } |
562 // Copy the remainder of in to out. | 568 // Copy the remainder of in to out. |
563 while (*in != '\0') { | 569 while (*in != '\0') { |
564 *out++ = *in++; | 570 *out++ = *in++; |
565 } | 571 } |
566 *out = '\0'; | 572 *out = '\0'; |
567 } | 573 } |
568 | 574 |
569 } // namespace dart | 575 } // namespace dart |
OLD | NEW |