summaryrefslogtreecommitdiff
path: root/libdeno/test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libdeno/test.cc')
-rw-r--r--libdeno/test.cc16
1 files changed, 14 insertions, 2 deletions
diff --git a/libdeno/test.cc b/libdeno/test.cc
index e97ba3f01..c178d109a 100644
--- a/libdeno/test.cc
+++ b/libdeno/test.cc
@@ -1,8 +1,20 @@
// Copyright 2018 the Deno authors. All rights reserved. MIT license.
-#include "deno.h"
-#include "testing/gtest/include/gtest/gtest.h"
+#include "test.h"
+#include "file_util.h"
+
+deno_buf snapshot = {nullptr, 0, nullptr, 0};
int main(int argc, char** argv) {
+ // Load the snapshot.
+ std::string contents;
+ if (!deno::ReadFileToString(SNAPSHOT_PATH, &contents)) {
+ printf("Failed to read file %s\n", SNAPSHOT_PATH);
+ return 1;
+ }
+ snapshot.data_ptr =
+ reinterpret_cast<uint8_t*>(const_cast<char*>(contents.c_str()));
+ snapshot.data_len = contents.size();
+
testing::InitGoogleTest(&argc, argv);
deno_init();
deno_set_v8_flags(&argc, argv);