标签:cts
debug的入口在CtsConsole类,所以我们把第一个断点打在249行:
Console console = new CtsConsole();
按F6再按F5进入到Console.startConsole方法中。
按F5进入GlobalConfiguration.createGlobalConfiguration方法中。
该方法内主要是读取全局配置文件并设置IGlobalConfiguration接口对象sInstance。主要方法为95行读取文件的getGlobalConfigPath():
private static String getGlobalConfigPath() throws ConfigurationException {
String path = System.getenv(GLOBAL_CONFIG_VARIABLE);
if (path != null) {
// don't actually check for accessibility here, since the variable
// might be specifying
// a java resource rather than a filename. Even so, this can help
// the user figure out
// which global config (if any) was picked up by TF.
System.err
.format("Attempting to use global config \"%s\" from variable $%s.\n",
path, GLOBAL_CONFIG_VARIABLE);
return path;
}
File file = new File(GLOBAL_CONFIG_FILENAME);
if (file.exists()) {
path = file.getPath();
System.err.format(
"Attempting to use auto detected global config \"%s\".\n",
path);
System.err.flush();
return path;
}
// FIXME: search in tradefed.sh launch dir (or classpath?)
return null;
}
if (globalConfigPath != null) {
// Found a global config file; attempt to parse and use it
sInstance = configFactory.createGlobalConfigurationFromArgs(
ArrayUtil.buildArray(new String[] { globalConfigPath },
args), nonGlobalArgs);
System.err.format("Success! Using global config \"%s\"\n",
globalConfigPath);
} else {
// Use default global config
sInstance = new GlobalConfiguration();
nonGlobalArgs = Arrays.asList(args);
}
return nonGlobalArgs;
下一篇继续
标签:cts
原文地址:http://blog.csdn.net/itfootball/article/details/40210811