From cf0c6ef642517fba3bc9a211acaed742ff39b86d Mon Sep 17 00:00:00 2001 From: David Srbecky Date: Wed, 5 Feb 2020 16:25:36 +0000 Subject: 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 --- runtime/common_runtime_test.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'runtime/common_runtime_test.h') diff --git a/runtime/common_runtime_test.h b/runtime/common_runtime_test.h index c87d317a81..2e9e078be9 100644 --- a/runtime/common_runtime_test.h +++ b/runtime/common_runtime_test.h @@ -113,6 +113,24 @@ class CommonRuntimeTestImpl : public CommonArtTestImpl { bool StartDex2OatCommandLine(/*out*/std::vector* argv, /*out*/std::string* error_msg); + bool CompileBootImage(const std::vector& extra_args, + const std::string& image_file_name_prefix, + ArrayRef dex_files, + ArrayRef dex_locations, + std::string* error_msg, + const std::string& use_fd_prefix = ""); + + bool CompileBootImage(const std::vector& extra_args, + const std::string& image_file_name_prefix, + ArrayRef 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& args, std::string* error_msg); + protected: // Allow subclases such as CommonCompilerTest to add extra options. virtual void SetUpRuntimeOptions(RuntimeOptions* options ATTRIBUTE_UNUSED) {} -- cgit v1.2.3-59-g8ed1b