Trade Federation 中的全域篩選器

全域篩選器可將測試篩選器提供給 Tradefed,這些篩選器會自動套用至叫用,不必擔心測試是否支援。

如果設定不支援篩選,就會處於無效狀態,但不會像 Tradefed 通常的情況一樣擲回設定例外狀況,因此仍有優點。這樣一來,對 Tradefed 瞭解不多的服務就能輕鬆產生並提供一般篩選器標記。

語法

--global-filters:include-filter [abi] module-name [test-class][#method-name]

--global-filters:exclude-filter [abi] module-name [test-class][#method-name]

其中 module-name 是唯一必須提供的部分。

例如:

  • --global-filters:include-filter moduleA:只會執行模組
  • --global-filters:include-filter moduleA class#method:只會執行相符的方法

如需更多篩選器,可以重複這個選項。排除條件的優先順序高於納入條件。

實作

原始碼