Device gtests: Use boot.art instead of core.art.
They are essentially the same. We can use boot.art to run gtests
since it is already part of the apex, including the jar files.
This will make it easier to run the tests in atest, since we
will not have to worry about copying core.art to the device.
The long-term goal is to avoid generating core.art altogether.
Couple of tests also require "alternate" image which has no
compiled code. The tests now generate it on-demand in code.
The host gtests still use core.art for now (as there is no
boot.art on host). The plan is to add it in future CLs.
Test: m test-art-host-gtest
Test: ./art/tools/run-gtests.sh
Bug: 147817606
Change-Id: I3a750bb8e60eea0b4a7df1491285feffd5a0161c
diff --git a/runtime/common_runtime_test.h b/runtime/common_runtime_test.h
index c87d317..2e9e078 100644
--- a/runtime/common_runtime_test.h
+++ b/runtime/common_runtime_test.h
@@ -113,6 +113,24 @@
bool StartDex2OatCommandLine(/*out*/std::vector<std::string>* argv,
/*out*/std::string* error_msg);
+ bool CompileBootImage(const std::vector<std::string>& extra_args,
+ const std::string& image_file_name_prefix,
+ ArrayRef<const std::string> dex_files,
+ ArrayRef<const std::string> dex_locations,
+ std::string* error_msg,
+ const std::string& use_fd_prefix = "");
+
+ bool CompileBootImage(const std::vector<std::string>& extra_args,
+ const std::string& image_file_name_prefix,
+ ArrayRef<const std::string> dex_files,
+ std::string* error_msg,
+ const std::string& use_fd_prefix = "") {
+ return CompileBootImage(
+ extra_args, image_file_name_prefix, dex_files, dex_files, error_msg, use_fd_prefix);
+ }
+
+ bool RunDex2Oat(const std::vector<std::string>& args, std::string* error_msg);
+
protected:
// Allow subclases such as CommonCompilerTest to add extra options.
virtual void SetUpRuntimeOptions(RuntimeOptions* options ATTRIBUTE_UNUSED) {}