测试映射

public class TestMapping
extends Object

java.lang.Object
com.android.tradefed.util.testmapping.TestMapping


用于加载 TEST_MAPPING 文件的类。

概括

领域

public static final Pattern MAINLINE_REGEX

public static final String TEST_MAPPINGS_ZIP

public static final String TEST_SOURCES

公共构造函数

TestMapping ()

用于初始化空TestMapping对象的构造函数。

TestMapping ( testMappingRelativePaths, boolean ignoreTestMappingImports) TestMapping ( testMappingRelativePaths, boolean ignoreTestMappingImports)

用于创建TestMapping对象的构造函数。

公共方法

static File extractTestMappingsZip (File testMappingsZip)

解压缩 zip 文件并返回包含解压缩文件内容的目录。

getAllTests (File testMappingsDir)

帮助程序从给定目录查找 TEST_MAPPING 文件中的所有测试。

static Matcher getMainlineTestModuleName ( TestInfo info)

帮助程序获取参数化主线测试的匹配器。

getTests ( IBuildInfo buildInfo, String testGroup, boolean hostOnly, keywords, ignoreKeywords) getTests ( IBuildInfo buildInfo, String testGroup, boolean hostOnly, keywords, ignoreKeywords) getTests ( IBuildInfo buildInfo, String testGroup, boolean hostOnly, keywords, ignoreKeywords)

帮助程序根据设备构建中的工件查找所有 TEST_MAPPING 文件中的所有测试。

getTests ( IBuildInfo buildInfo, String testGroup, boolean hostOnly, keywords, ignoreKeywords, extraZipNames, matchedPatternPaths) getTests ( IBuildInfo buildInfo, String testGroup, boolean hostOnly, keywords, ignoreKeywords, extraZipNames, matchedPatternPaths) getTests ( IBuildInfo buildInfo, String testGroup, boolean hostOnly, keywords, ignoreKeywords, extraZipNames, matchedPatternPaths) getTests ( IBuildInfo buildInfo, String testGroup, boolean hostOnly, keywords, ignoreKeywords, extraZipNames, matchedPatternPaths) getTests ( IBuildInfo buildInfo, String testGroup, boolean hostOnly, keywords, ignoreKeywords, extraZipNames, matchedPatternPaths)

帮助程序根据给定的工件查找所有 TEST_MAPPING 文件中的所有测试。

void listTestMappingFiles (Path testMappingDir, Path testMappingsRootDir, filePaths) listTestMappingFiles (Path testMappingDir, Path testMappingsRootDir, filePaths)

帮助程序列出所有测试映射文件,查找所有父目录和相关导入路径。

领域

MAINLINE_REGEX

public static final Pattern MAINLINE_REGEX

测试_MAPPINGS_ZIP

public static final String TEST_MAPPINGS_ZIP

测试源

public static final String TEST_SOURCES

公共构造函数

测试映射

public TestMapping ()

用于初始化空TestMapping对象的构造函数。

测试映射

public TestMapping ( testMappingRelativePaths, 
                boolean ignoreTestMappingImports)

用于创建TestMapping对象的构造函数。

参数
testMappingRelativePathsERROR(/List ) ERROR(/List )到 TEST_MAPPING 文件路径。

ignoreTestMappingImports boolean :忽略导入的ERROR(/boolean)

公共方法

extractTestMappingsZip

public static File extractTestMappingsZip (File testMappingsZip)

解压缩 zip 文件并返回包含解压缩文件内容的目录。

参数
testMappingsZip File :要提取的测试映射 zip ERROR(/File)

退货
File指向测试映射 zip 的临时目录的ERROR(/File)

获取所有测试

public  getAllTests (File testMappingsDir)

帮助程序从给定目录查找 TEST_MAPPING 文件中的所有测试。

参数
testMappingsDir FileERROR(/File)包含所有测试映射文件的目录。

退货
给定目录及其子目录中的测试的Map<String, Set<TestInfo>>

获取主线测试模块名称

public static Matcher getMainlineTestModuleName (TestInfo info)

帮助程序获取参数化主线测试的匹配器。

参数
info TestInfo

退货
Matcher参数化主线测试的ERROR(/Matcher)

投掷
ConfigurationException

获取测试

public  getTests (IBuildInfo buildInfo, 
                String testGroup, 
                boolean hostOnly, 
                 keywords, 
                 ignoreKeywords)

帮助程序根据设备构建中的工件查找所有 TEST_MAPPING 文件中的所有测试。

参数
buildInfo IBuildInfo :描述构建的IBuildInfo

testGroup String :测试组的String

hostOnly boolean :如果仅在主机上运行测试且不需要设备,则应返回 true。 false 返回需要设备运行的测试。

keywords :过滤要在测试映射套件中运行的测试时要匹配的一组String

ignoreKeywords :一组要忽略的关键字String

退货
构建工件 test_mappings.zip 中设置的一Set<TestInfo>测试。

获取测试

public  getTests (IBuildInfo buildInfo, 
                String testGroup, 
                boolean hostOnly, 
                 keywords, 
                 ignoreKeywords, 
                 extraZipNames, 
                 matchedPatternPaths)

帮助程序根据给定的工件查找所有 TEST_MAPPING 文件中的所有测试。当套件运行需要运行给定组的 TEST_MAPPING 文件中的所有测试(例如预提交)时,需要执行此操作。

参数
buildInfo IBuildInfo :描述构建的IBuildInfo

testGroup String :测试组的String

hostOnly boolean :如果仅在主机上运行测试且不需要设备,则应返回 true。 false 返回需要设备运行的测试。

keywords :过滤要在测试映射套件中运行的测试时要匹配的一组String

ignoreKeywords :一组要忽略的关键字String

extraZipNames :一组String表示将要合并的附加 test_mappings.zip 的名称。

matchedPatternPathsERROR(/Set ) ERROR(/Set )到文件路径匹配的模式。

退货
构建工件 test_mappings.zip 中设置的一Set<TestInfo>测试。

列出测试映射文件

public void listTestMappingFiles (Path testMappingDir, 
                Path testMappingsRootDir, 
                 filePaths)

帮助程序列出所有测试映射文件,查找所有父目录和相关导入路径。

参数
testMappingDir Path :TEST_MAPPING 文件父目录的ERROR(/Path)

testMappingsRootDir Path :构建的所有 TEST_MAPPING 文件的文件夹的ERROR(/Path)

filePaths :一个ERROR(/Set ) ERROR(/Set )来存储所有 TEST_MAPPING 路径。