Home | History | Annotate | Download | only in 117-nopatchoat
      1 #!/bin/bash
      2 #
      3 # Copyright (C) 2014 The Android Open Source Project
      4 #
      5 # Licensed under the Apache License, Version 2.0 (the "License");
      6 # you may not use this file except in compliance with the License.
      7 # You may obtain a copy of the License at
      8 #
      9 #     http://www.apache.org/licenses/LICENSE-2.0
     10 #
     11 # Unless required by applicable law or agreed to in writing, software
     12 # distributed under the License is distributed on an "AS IS" BASIS,
     13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     14 # See the License for the specific language governing permissions and
     15 # limitations under the License.
     16 
     17 # ensure flags includes prebuild and relocate. It doesn't make sense unless we
     18 # have a oat file we want to relocate.
     19 flags="$@"
     20 
     21 # This test is supposed to test with oat files. Make sure that the no-prebuild flag isn't set,
     22 # or complain.
     23 # Note: prebuild is the default.
     24 if [[ "${flags}" == *--no-prebuild* ]] ; then
     25   echo "Test 117-nopatchoat is not intended to run in no-prebuild mode."
     26   exit 1
     27 fi
     28 
     29 # This test is supposed to test relocation. Make sure that the no-relocate flag isn't set,
     30 # or complain.
     31 # Note: relocate is the default.
     32 if [[ "${flags}" == *--no-relocate* ]] ; then
     33   echo "Test 117-nopatchoat is not intended to run in no-relocate mode."
     34   exit 1
     35 fi
     36 
     37 # Make sure we can run without relocation
     38 echo "Run without dex2oat/patchoat"
     39 ${RUN} ${flags} --runtime-option -Xnodex2oat
     40 
     41 # Make sure we can run with the oat file.
     42 echo "Run with dexoat/patchoat"
     43 ${RUN} ${flags} --runtime-option -Xdex2oat
     44 
     45 # Make sure we can run with the default settings.
     46 echo "Run default"
     47 ${RUN} ${flags}
     48