測試映射
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路徑。 |