#!/bin/bash # Copyright (C) 2018 The Android Open Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # # Run ART APEX tests. SCRIPT_DIR=$(dirname $0) # Status of whole test script. exit_status=0 # Status of current test suite. test_status=0 function say { echo "$0: $*" } function die { echo "$0: $*" exit 1 } function setup_die { die "You need to run lunch, banchan, or tapas before you can use this script." } [[ -n "$ANDROID_BUILD_TOP" ]] || setup_die [[ -n "$ANDROID_PRODUCT_OUT" ]] || setup_die [[ -n "$ANDROID_HOST_OUT" ]] || setup_die flattened_apex_p=$($ANDROID_BUILD_TOP/build/soong/soong_ui.bash \ --dumpvar-mode TARGET_FLATTEN_APEX) \ || setup_die compressed_apex_p=$($ANDROID_BUILD_TOP/build/soong/soong_ui.bash \ --dumpvar-mode PRODUCT_COMPRESSED_APEX) \ || setup_die # Switch the build system to unbundled mode in the reduced manifest branch. if [ ! -d $ANDROID_BUILD_TOP/frameworks/base ]; then export TARGET_BUILD_UNBUNDLED=true fi have_deapexer_p=false if $flattened_apex_p; then :; else if [ ! -e "$ANDROID_HOST_OUT/bin/deapexer" -o ! -e "$ANDROID_HOST_OUT/bin/debugfs_static" ] ; then say "Could not find deapexer and/or debugfs_static, building now." build/soong/soong_ui.bash --make-mode deapexer debugfs_static-host || \ die "Cannot build deapexer and debugfs_static" fi have_deapexer_p=true fi # Fail early. set -e build_apex_p=true list_image_files_p=false print_image_tree_p=false print_file_sizes_p=false function usage { cat <