1@echo off 2rem Copyright (C) 2008 The Android Open Source Project 3rem 4rem Licensed under the Apache License, Version 2.0 (the "License"); 5rem you may not use this file except in compliance with the License. 6rem You may obtain a copy of the License at 7rem 8rem http://www.apache.org/licenses/LICENSE-2.0 9rem 10rem Unless required by applicable law or agreed to in writing, software 11rem distributed under the License is distributed on an "AS IS" BASIS, 12rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13rem See the License for the specific language governing permissions and 14rem limitations under the License. 15 16rem don't modify the caller's environment 17setlocal 18 19rem Set up prog to be the path of this script, including following symlinks, 20rem and set up progdir to be the fully-qualified pathname of its directory. 21set prog=%~f0 22 23set curdir=%CD% 24 25rem Change current directory to where cts is, to avoid issues with directories 26rem containing whitespaces. 27cd %~dp0 28 29set jarfile=cts.jar 30set frameworkdir= 31set libdir= 32 33rem parse the argument 34if (%1)==() ( 35 set argument=%CTS_HOST_CFG% 36 goto ArgumentOk 37) else ( 38 set argument=%1 39) 40 41if not "%argument:~1,1%"==":" ( 42 set argument=%curdir%\%argument% 43) 44 45:ArgumentOk 46 47if exist %frameworkdir%%jarfile% goto JarFileOk 48 set frameworkdir=lib\ 49 set libdir=lib\ 50 51if exist %frameworkdir%%jarfile% goto JarFileOk 52 set frameworkdir=..\framework\ 53 set libdir=..\lib\ 54 55:JarFileOk 56 57if debug NEQ "%1" goto NoDebug 58 set java_debug=-agentlib:jdwp=transport=dt_socket,server=y,address=8050,suspend=y 59 shift 1 60:NoDebug 61 62set jarpath=%frameworkdir%%jarfile% 63 64call java %java_debug% -Djava.ext.dirs=%frameworkdir% -Djava.library.path=%libdir% -Dcom.android.cts.bindir= -jar %jarpath% %argument% 65