測試映射
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) 用於從 TEST_MAPPING 檔案的路徑建立 |
公共方法 | |
---|---|
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) 幫助程式列出所有測試映射文件,尋找所有父目錄和相關導入路徑。 |
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)
用於從 TEST_MAPPING 檔案的路徑建立TestMapping
物件的建構子。
參數 | |
---|---|
path | Path :TEST_MAPPING 檔案的ERROR(/Path) 。 |
testMappingsDir | Path :建置的所有 TEST_MAPPING 檔案的資料夾的ERROR(/Path) 。 |
公共方法
extractTestMappingsZip
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>> 。 |
取得主線測試模組名稱
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 。 |
退貨 | |
---|---|
測試資訊的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 |
退貨 | |
---|---|
建構工件 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 路徑。 |
設定忽略測試映射導入
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> 。 |