测试映射
public class TestMapping
extends Object
对象 | |
↳ | com.android.tradefed.util.testmapping.TestMapping |
用于加载 TEST_MAPPING 文件的类。
概括
字段 | |
---|---|
public static final Pattern | MAINLINE_REGEX |
public static final String | TEST_SOURCES
|
公共构造函数 | |
---|---|
TestMapping (Path path, Path testMappingsDir) 构造函数创建一个 |
公共方法 | |
---|---|
static File | extractTestMappingsZip (File testMappingsZip) 解压缩 zip 文件并返回包含解压缩文件内容的目录。 |
static | getAllTests (File testMappingsDir) 帮助程序从给定目录中查找 TEST_MAPPING 文件中的所有测试。 |
static Matcher | getMainlineTestModuleName ( TestInfo info) 帮助获取参数化主线测试的匹配器。 |
getTests (String testGroup, disabledTests, boolean hostOnly, keywords) getTests (String testGroup, disabledTests, boolean hostOnly, keywords) getTests (String testGroup, disabledTests, boolean hostOnly, keywords) 帮助程序在给定组的 TEST_MAPPING 文件中设置所有测试。 | |
static | getTests (IBuildInfo buildInfo, String testGroup, boolean hostOnly, keywords) getTests (IBuildInfo buildInfo, String testGroup, boolean hostOnly, keywords) 在所有 TEST_MAPPING 文件中查找所有测试的助手。 |
static void | listTestMappingFiles (Path testMappingDir, Path testMappingsRootDir, filePaths) listTestMappingFiles (Path testMappingDir, Path testMappingsRootDir, filePaths) Helper 列出所有测试映射文件,查找所有父目录和相关导入路径。 |
static void | setIgnoreTestMappingImports (boolean ignoreTestMappingImports) 在 TestMapping 中设置 mIgnoreTestMappingImports。 |
static void | setTestMappingPaths ( relativePaths) setTestMappingPaths ( relativePaths) 在 TEST_MAPPINGS_ZIP 内设置 TEST_MAPPING 路径以限制加载 TEST_MAPPING。 |
字段
MAINLINE_REGEX
public static final Pattern MAINLINE_REGEX
TEST_SOURCES
public static final String TEST_SOURCES
公共构造函数
测试映射
public TestMapping (Path path, Path testMappingsDir)
构造函数创建一个TestMapping
从到TEST_MAPPING文件的路径对象。
参数 | |
---|---|
path | Path :该ERROR(/Path) 到TEST_MAPPING文件。 |
testMappingsDir | Path :该ERROR(/Path) 用于构建所有TEST_MAPPING文件的文件夹。 |
公共方法
提取测试映射Zip
public static File extractTestMappingsZip (File testMappingsZip)
解压缩 zip 文件并返回包含解压缩文件内容的目录。
参数 | |
---|---|
testMappingsZip | File :一个ERROR(/File) 的测试映射的拉链到提取物。 |
退货 | |
---|---|
File | 一个ERROR(/File) 指向temp目录测试映射压缩。 |
获取所有测试
public staticgetAllTests (File testMappingsDir)
帮助程序从给定目录中查找 TEST_MAPPING 文件中的所有测试。
参数 | |
---|---|
testMappingsDir | File :在ERROR(/File) 包含所有测试映射文件的目录。 |
退货 | |
---|---|
一个Map<String, Set<TestInfo>> 的指定目录下的测试及其子目录。 |
getMainlineTestModuleName
public static Matcher getMainlineTestModuleName (TestInfo info)
帮助获取参数化主线测试的匹配器。
参数 | |
---|---|
info | TestInfo |
退货 | |
---|---|
Matcher | 甲ERROR(/Matcher) 参数化主线测试。 |
投掷 | |
---|---|
ConfigurationException |
获取测试
publicgetTests (String testGroup, disabledTests, boolean hostOnly, keywords)
帮助程序在给定组的 TEST_MAPPING 文件中设置所有测试。
参数 | |
---|---|
testGroup | String :一个String 测试组。 |
disabledTests | String 残疾人测试的名称。 |
hostOnly | boolean :如果为true运行在主机上唯一的测试,不需要设备应返回。 false 返回需要设备运行的测试。 |
keywords | String 进行滤波测试,以在测试Mapping套件运行时进行匹配。 |
退货 | |
---|---|
甲Set<TestInfo> 测试的相关信息。 |
获取测试
public staticgetTests (IBuildInfo buildInfo, String testGroup, boolean hostOnly, keywords)
在所有 TEST_MAPPING 文件中查找所有测试的助手。当套件运行需要为给定组运行 TEST_MAPPING 文件中的所有测试时,这是必需的,例如,预提交。
参数 | |
---|---|
buildInfo | IBuildInfo :在IBuildInfo 描述的构建。 |
testGroup | String :一个String 的测试组的。 |
hostOnly | boolean :如果为true运行在主机上唯一的测试,不需要设备应返回。 false 返回需要设备运行的测试。 |
keywords |
退货 | |
---|---|
甲Set<TestInfo> 的在构建工件设置测试,test_mappings.zip。 |
列表测试映射文件
public static void listTestMappingFiles (Path testMappingDir, Path testMappingsRootDir,filePaths)
Helper 列出所有测试映射文件,查找所有父目录和相关导入路径。
参数 | |
---|---|
testMappingDir | Path :该ERROR(/Path) 到TEST_MAPPING文件父目录。 |
testMappingsRootDir | Path :该ERROR(/Path) 用于构建所有TEST_MAPPING文件的文件夹。 |
filePaths | ERROR(/Set ) ERROR(/Set ) 来存储所有TEST_MAPPING路径。 |
setIgnoreTestMappingImports
public static void setIgnoreTestMappingImports (boolean ignoreTestMappingImports)
在 TestMapping 中设置 mIgnoreTestMappingImports。
参数 | |
---|---|
ignoreTestMappingImports | boolean :是否忽略测试映射进口的布尔值。 |
设置测试映射路径
public static void setTestMappingPaths (relativePaths)
在 TEST_MAPPINGS_ZIP 内设置 TEST_MAPPING 路径以限制加载 TEST_MAPPING。
参数 | |
---|---|
relativePaths | List<String> 相对于TEST_MAPPINGS_ZIP TEST_MAPPING路径。 |