測試映射
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 ( testMappingRelativePaths, boolean ignoreTestMappingImports) TestMapping ( testMappingRelativePaths, boolean ignoreTestMappingImports) 用於建立 |
公共方法 | |
---|---|
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 (testMappingRelativePaths, boolean ignoreTestMappingImports)
用於建立TestMapping
物件的建構子。
參數 | |
---|---|
testMappingRelativePaths | ERROR(/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) 。 |
取得所有測試
publicgetAllTests (File testMappingsDir)
幫助程式從給定目錄尋找 TEST_MAPPING 檔案中的所有測試。
參數 | |
---|---|
testMappingsDir | File : ERROR(/File) 包含所有測試映射檔案的目錄。 |
退貨 | |
---|---|
給定目錄及其子目錄中的測試的Map<String, Set<TestInfo>> 。 |
取得主線測試模組名稱
public static Matcher getMainlineTestModuleName (TestInfo info)
幫助程式取得參數化主線測試的匹配器。
參數 | |
---|---|
info | TestInfo |
退貨 | |
---|---|
Matcher | 參數化主線測試的ERROR(/Matcher) 。 |
投擲 | |
---|---|
ConfigurationException |
取得測試
publicgetTests (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> 測試。 |
取得測試
publicgetTests (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 的名稱。 |
matchedPatternPaths | ERROR(/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 路徑。 |