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

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

Issue 1660063002: Remove many features when building product mode (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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/coverage.cc ('k') | runtime/vm/dart.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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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/coverage.h" 5 #include "vm/coverage.h"
6 #include "vm/dart_api_impl.h" 6 #include "vm/dart_api_impl.h"
7 #include "vm/unit_test.h" 7 #include "vm/unit_test.h"
8 8
9 namespace dart { 9 namespace dart {
10 10
11 #ifndef PRODUCT
12
11 static RawObject* ExecuteScript(const char* script) { 13 static RawObject* ExecuteScript(const char* script) {
12 TransitionVMToNative transition(Thread::Current()); 14 TransitionVMToNative transition(Thread::Current());
13 Dart_Handle h_lib = TestCase::LoadTestScript(script, NULL); 15 Dart_Handle h_lib = TestCase::LoadTestScript(script, NULL);
14 EXPECT_VALID(h_lib); 16 EXPECT_VALID(h_lib);
15 Library& lib = Library::Handle(); 17 Library& lib = Library::Handle();
16 lib ^= Api::UnwrapHandle(h_lib); 18 lib ^= Api::UnwrapHandle(h_lib);
17 EXPECT(!lib.IsNull()); 19 EXPECT(!lib.IsNull());
18 Dart_Handle result = Dart_Invoke(h_lib, NewString("main"), 0, NULL); 20 Dart_Handle result = Dart_Invoke(h_lib, NewString("main"), 0, NULL);
19 EXPECT_VALID(result); 21 EXPECT_VALID(result);
20 return Api::UnwrapHandle(h_lib); 22 return Api::UnwrapHandle(h_lib);
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 // Only expect coverage data for Foo.yetAnother() on line 6. 132 // Only expect coverage data for Foo.yetAnother() on line 6.
131 char buf[1024]; 133 char buf[1024];
132 OS::SNPrint(buf, sizeof(buf), 134 OS::SNPrint(buf, sizeof(buf),
133 "{\"source\":\"test-lib\",\"script\":{\"type\":\"@Script\"," 135 "{\"source\":\"test-lib\",\"script\":{\"type\":\"@Script\","
134 "\"fixedId\":true,\"id\":\"libraries\\/%" Pd "\\/scripts\\/test-lib\"," 136 "\"fixedId\":true,\"id\":\"libraries\\/%" Pd "\\/scripts\\/test-lib\","
135 "\"uri\":\"test-lib\"," 137 "\"uri\":\"test-lib\","
136 "\"_kind\":\"script\"},\"hits\":[6,0]}", lib.index()); 138 "\"_kind\":\"script\"},\"hits\":[6,0]}", lib.index());
137 EXPECT_SUBSTRING(buf, js.ToCString()); 139 EXPECT_SUBSTRING(buf, js.ToCString());
138 } 140 }
139 141
142 #endif // !PRODUCT
143
140 } // namespace dart 144 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/coverage.cc ('k') | runtime/vm/dart.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698