1 /*
2  * Copyright (C) 2022 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 /** Utils for testing with minimal dependencies. */
18 
19 #ifndef ART_LIBARTBASE_BASE_TESTING_H_
20 #define ART_LIBARTBASE_BASE_TESTING_H_
21 
22 #include <string>
23 #include <vector>
24 
25 namespace art {
26 namespace testing {
27 
28 // Note: "libcore" here means art + conscrypt + icu.
29 
30 // Gets the names of the libcore modules.
31 // If `core_only` is true, only returns the names of CORE_IMG_JARS in Android.common_path.mk.
32 std::vector<std::string> GetLibCoreModuleNames(bool core_only = false);
33 
34 // Gets the paths of the libcore dex files for given modules.
35 std::vector<std::string> GetLibCoreDexFileNames(const std::string& prefix,
36                                                 const std::vector<std::string>& modules);
37 
38 // Gets the paths of the libcore dex files.
39 // If `core_only` is true, only returns the filenames of CORE_IMG_JARS in Android.common_path.mk.
40 std::vector<std::string> GetLibCoreDexFileNames(const std::string& prefix, bool core_only = false);
41 
42 // Gets the on-device locations of the libcore dex files for given modules.
43 std::vector<std::string> GetLibCoreDexLocations(const std::vector<std::string>& modules);
44 
45 // Gets the on-device locations of the libcore dex files.
46 // If `core_only` is true, only returns the filenames of CORE_IMG_JARS in Android.common_path.mk.
47 std::vector<std::string> GetLibCoreDexLocations(bool core_only = false);
48 
49 }  // namespace testing
50 }  // namespace art
51 
52 #endif  // ART_LIBARTBASE_BASE_TESTING_H_
53