測試映射
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_SOURCES
|
公共構造函數 | |
---|---|
TestMapping (Path path, Path testMappingsDir, matchedPatternPaths) TestMapping (Path path, Path testMappingsDir, matchedPatternPaths) 從 TEST_MAPPING 文件的路徑創建 |
公共方法 | |
---|---|
static File | extractTestMappingsZip (File testMappingsZip) 提取 zip 文件並返回包含解壓縮文件內容的目錄。 |
static | getAllTests (File testMappingsDir) 從給定目錄的 TEST_MAPPING 文件中查找所有測試的幫助程序。 |
static Matcher | getMainlineTestModuleName ( TestInfo info) 幫助程序獲取參數化主線測試的匹配器。 |
static | getTests ( IBuildInfo buildInfo, String testGroup, boolean hostOnly, keywords, extraZipNames, matchedPatternPaths) getTests ( IBuildInfo buildInfo, String testGroup, boolean hostOnly, keywords, extraZipNames, matchedPatternPaths) getTests ( IBuildInfo buildInfo, String testGroup, boolean hostOnly, keywords, extraZipNames, matchedPatternPaths) getTests ( IBuildInfo buildInfo, String testGroup, boolean hostOnly, keywords, extraZipNames, matchedPatternPaths) 幫助程序根據給定的工件在所有 TEST_MAPPING 文件中查找所有測試。 |
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) 列出所有測試映射文件、查找所有父目錄和相關導入路徑的助手。 |
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
測試源
public static final String TEST_SOURCES
公共構造函數
測試映射
public TestMapping (Path path, Path testMappingsDir,matchedPatternPaths)
從 TEST_MAPPING 文件的路徑創建TestMapping
對象的構造函數。
參數 | |
---|---|
path | Path :TEST_MAPPING 文件的ERROR(/Path) 。 |
testMappingsDir | Path :構建的所有 TEST_MAPPING 文件所在文件夾的ERROR(/Path) 。 |
matchedPatternPaths | ERROR(/Set ) ERROR(/Set ) 到文件路徑匹配的模式。 |
公共方法
提取TestMappingsZip
public static File extractTestMappingsZip (File testMappingsZip)
提取 zip 文件並返回包含解壓縮文件內容的目錄。
參數 | |
---|---|
testMappingsZip | File :要提取的測試映射 zip 的ERROR(/File) 。 |
退貨 | |
---|---|
File | 指向測試映射 zip 臨時目錄的ERROR(/File) 。 |
獲取所有測試
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 |
獲取測試
public staticgetTests (IBuildInfo buildInfo, String testGroup, boolean hostOnly, keywords, extraZipNames, matchedPatternPaths)
幫助程序根據給定的工件在所有 TEST_MAPPING 文件中查找所有測試。當套件運行需要運行給定組的 TEST_MAPPING 文件中的所有測試時,這是必需的,例如,預提交。
參數 | |
---|---|
buildInfo | IBuildInfo :描述構建的IBuildInfo 。 |
testGroup | String : 測試組的ERROR(/String) 。 |
hostOnly | boolean : true 如果只在主機上運行測試並且不需要返回設備。 false 返回需要設備運行的測試。 |
keywords | ERROR(/String) 在過濾測試以在測試映射套件中運行時匹配。 |
extraZipNames | ERROR(/String) 。 |
matchedPatternPaths | ERROR(/Set ) ERROR(/Set ) 到文件路徑匹配的模式。 |
退貨 | |
---|---|
構建工件 test_mappings.zip 中測試集的Set<TestInfo> 。 |
獲取測試
publicgetTests (String testGroup, disabledTests, boolean hostOnly, keywords)
為給定組在 TEST_MAPPING 文件中設置所有測試的幫助程序。
參數 | |
---|---|
testGroup | String : 測試組的ERROR(/String) 。 |
disabledTests | ERROR(/String) 用於禁用測試的名稱。 |
hostOnly | boolean : true 如果只在主機上運行測試並且不需要返回設備。 false 返回需要設備運行的測試。 |
keywords | ERROR(/String) 在過濾測試以在測試映射套件中運行時匹配。 |
退貨 | |
---|---|
測試信息的Set<TestInfo> 。 |
獲取測試
public staticgetTests (IBuildInfo buildInfo, String testGroup, boolean hostOnly, keywords)
幫助程序根據設備構建中的工件在所有 TEST_MAPPING 文件中查找所有測試。
參數 | |
---|---|
buildInfo | IBuildInfo :描述構建的IBuildInfo 。 |
testGroup | String : 測試組的ERROR(/String) 。 |
hostOnly | boolean : true 如果只在主機上運行測試並且不需要返回設備。 false 返回需要設備運行的測試。 |
keywords | ERROR(/String) 在過濾測試以在測試映射套件中運行時匹配。 |
退貨 | |
---|---|
構建工件 test_mappings.zip 中測試集的Set<TestInfo> 。 |
列出測試映射文件
public static 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 路徑。 |
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> 。 |