KTapResultParser

public class KTapResultParser
extends Object

java.lang.Object
   ↳ com.android.tradefed.testtype.binary.KTapResultParser


讀取 KUnit 測試模組產生的 KTAP 輸出內容,並放在 debugfs 下的 `results` 檔案中。

這項實作內容是以官方文件、kunit_parser.py 和測試期間發現的特定注意事項為依據。需要額外邏輯:

  • 由於使用方式不一致,因此系統會忽略縮排。
  • 開頭為「# Subtest:」的行必須正確巢狀嵌入子測試群組。這個方法取自 kunit_parser.py。
  • 有時未使用「#」時,測試名稱和診斷資料會以「-」開頭。遇到時會遭到移除。
  • 從技術上來說,測試名稱可使用「#」以外的任何字元。但翻譯成 TF 測試結果時,這可能會造成問題。目前只有後續處理作業,也就是將空格換成底線。

摘要

公用建構函式

KTapResultParser()

公用方法

static void applyKTapResultToListener(ITestInvocationListener listener, String testRunName, List<String> ktapFileContentList, KTapResultParser.ParseResolution resolution, boolean rearrangeClassMethod)
static void applyKTapResultToListener(ITestInvocationListener listener, String testRunName, List<String> ktapFileContentList, KTapResultParser.ParseResolution resolution)

公用建構函式

KTapResultParser

public KTapResultParser ()

公用方法

applyKTapResultToListener

public static void applyKTapResultToListener (ITestInvocationListener listener, 
                String testRunName, 
                List<String> ktapFileContentList, 
                KTapResultParser.ParseResolution resolution, 
                boolean rearrangeClassMethod)

參數
listener ITestInvocationListener

testRunName String

ktapFileContentList List

resolution KTapResultParser.ParseResolution

rearrangeClassMethod boolean

applyKTapResultToListener

public static void applyKTapResultToListener (ITestInvocationListener listener, 
                String testRunName, 
                List<String> ktapFileContentList, 
                KTapResultParser.ParseResolution resolution)

參數
listener ITestInvocationListener

testRunName String

ktapFileContentList List

resolution KTapResultParser.ParseResolution