| Index: runtime/vm/benchmark_test.h
|
| diff --git a/runtime/vm/benchmark_test.h b/runtime/vm/benchmark_test.h
|
| index 4b27abdf0d8e6fef1edb322abbacf3dd6101f7f6..ec357d2c0dd08e6b790d740f88dbecd91ebea20d 100644
|
| --- a/runtime/vm/benchmark_test.h
|
| +++ b/runtime/vm/benchmark_test.h
|
| @@ -12,6 +12,7 @@
|
| #include "vm/heap.h"
|
| #include "vm/isolate.h"
|
| #include "vm/object.h"
|
| +#include "vm/unit_test.h"
|
| #include "vm/zone.h"
|
|
|
| namespace dart {
|
| @@ -93,6 +94,19 @@ class BenchmarkIsolateScope {
|
| explicit BenchmarkIsolateScope(Benchmark* benchmark) : benchmark_(benchmark) {
|
| benchmark_->CreateIsolate(NULL);
|
| Dart_EnterScope(); // Create a Dart API scope for unit benchmarks.
|
| +
|
| + // Setup builtin library mock for 'print' in coreimpl.
|
| + const char* builtin_source =
|
| + "#library('dart:builtin');\n"
|
| + "void print(Object o) { }";
|
| + Dart_Handle coreimpl = Dart_LookupLibrary(Dart_NewString("dart:coreimpl"));
|
| + EXPECT_VALID(coreimpl);
|
| + Dart_Handle builtin = Dart_LoadLibrary(Dart_NewString("dart:builtin"),
|
| + Dart_NewString(builtin_source));
|
| + EXPECT_VALID(builtin);
|
| + Dart_Handle imported =
|
| + Dart_LibraryImportLibrary(coreimpl, builtin, Dart_NewString("builtin"));
|
| + EXPECT_VALID(imported);
|
| }
|
| ~BenchmarkIsolateScope() {
|
| Dart_ExitScope(); // Exit the Dart API scope created for unit tests.
|
|
|