Work on option parsing as prelude to image loading

Change-Id: I13edbd9b341e603817941beaca676535a7e590c7
diff --git a/src/image_test.cc b/src/image_test.cc
index 5de860e..c3662cd 100644
--- a/src/image_test.cc
+++ b/src/image_test.cc
@@ -20,8 +20,26 @@
 
   ImageWriter writer;
   ScratchFile tmp;
-  bool success = writer.Write(spaces[0], tmp.GetFilename(), reinterpret_cast<byte*>(0x5000000));
+  const int image_base = 0x5000000;
+  bool success = writer.Write(spaces[0], tmp.GetFilename(), reinterpret_cast<byte*>(image_base));
   EXPECT_TRUE(success);
+
+  // tear down old runtime and make a new one
+  delete runtime_.release();
+  java_lang_dex_file_.reset(GetLibCoreDex());
+
+  std::vector<const DexFile*> boot_class_path;
+  boot_class_path.push_back(java_lang_dex_file_.get());
+
+  Runtime::Options options;
+  options.push_back(std::make_pair("bootclasspath", &boot_class_path));
+  std::string boot_image("-Xbootimage:");
+  boot_image.append(tmp.GetFilename());
+  options.push_back(std::make_pair(boot_image.c_str(), reinterpret_cast<void*>(NULL)));
+
+  runtime_.reset(Runtime::Create(options, false));
+  ASSERT_TRUE(runtime_ != NULL);
+  class_linker_ = runtime_->GetClassLinker();
 }
 
 }  // namespace art