GTestResultParser
public
class
GTestResultParser
extends MultiLineReceiver
java.lang.Object | ||
↳ | com.android.ddmlib.MultiLineReceiver | |
↳ | com.android.tradefed.testtype.GTestResultParser |
シェルから実行される GTest を使用してネイティブ テストの「未加工出力モード」の結果を解析し、ITestInvocationListener に結果を通知します。
想定される出力の例:
[==========] Running 15 tests from 1 test case. [----------] Global test environment set-up. [----------] 15 tests from MessageTest [ RUN ] MessageTest.DefaultConstructor [ OK ] MessageTest.DefaultConstructor (1 ms) [ RUN ] MessageTest.CopyConstructor external/gtest/test/gtest-message_test.cc:67: Failure Value of: 5 Expected: 2 external/gtest/test/gtest-message_test.cc:68: Failure Value of: 1 == 1 Actual: true Expected: false [ FAILED ] MessageTest.CopyConstructor (2 ms) ... [ RUN ] MessageTest.DoesNotTakeUpMuchStackSpace [ OK ] MessageTest.DoesNotTakeUpMuchStackSpace (0 ms) [----------] 15 tests from MessageTest (26 ms total) [----------] Global test environment tear-down [==========] 15 tests from 1 test case ran. (26 ms total) [ PASSED ] 6 tests. [ FAILED ] 9 tests, listed below: [ FAILED ] MessageTest.CopyConstructor [ FAILED ] MessageTest.ConstructsFromCString [ FAILED ] MessageTest.StreamsCString [ FAILED ] MessageTest.StreamsNullCString [ FAILED ] MessageTest.StreamsString [ FAILED ] MessageTest.StreamsStringWithEmbeddedNUL [ FAILED ] MessageTest.StreamsNULChar [ FAILED ] MessageTest.StreamsInt [ FAILED ] MessageTest.StreamsBasicIoManip 9 FAILED TESTS
次のタグは、特定のイベントを通知するために使用されます。
[==========]: the first occurrence indicates a new run started, including the number of tests to be expected in this run [ RUN ]: indicates a new test has started to run; a series of zero or more lines may follow a test start, and will be captured in case of a test failure or error [ OK ]: the preceding test has completed successfully, optionally including the time it took to run (in ms) [ FAILED ]: the preceding test has failed, optionally including the time it took to run (in ms) [==========]: the preceding test run has completed, optionally including the time it took to run (in ms)
概要
パブリック コンストラクタ | |
---|---|
GTestResultParser(String testRunName,
GTestResultParser を作成します。 |
|
GTestResultParser(String testRunName,
GTestResultParser を作成します。 |
パブリック メソッド | |
---|---|
void
|
cancel()
テスト実行のキャンセルをリクエストします。 |
void
|
done()
adb セッションが完了したときに親から呼び出されます。 |
|
getFailedTests()
現在のテスト実行中に失敗したテストのリストを返します。 |
boolean
|
getPrependFileName()
|
boolean
|
isCancelled()
テスト実行がキャンセルされた場合は true を返します。 |
boolean
|
isTestRunIncomplete()
テスト実行が完了したかどうか。 |
void
|
processNewLines(String[] lines)
|
void
|
setPrependFileName(boolean prepend)
|
保護されたメソッド | |
---|---|
boolean
|
isUnexpectedTestFound()
単体テスト用に公開されています。 |
パブリック コンストラクタ
GTestResultParser
public GTestResultParser (String testRunName,listeners)
GTestResultParser を作成します。
パラメータ | |
---|---|
testRunName |
String : ITestLifeCycleReceiver.testRunStarted(String, int) に指定するテスト実行名 |
listeners |
: テストの実行中にテスト結果が通知される |
GTestResultParser
public GTestResultParser (String testRunName,listeners, boolean allowRustTestName)
GTestResultParser を作成します。
パラメータ | |
---|---|
testRunName |
String : ITestLifeCycleReceiver.testRunStarted(String, int) に指定するテスト実行名 |
listeners |
: テストの実行中にテスト結果が通知される |
allowRustTestName |
boolean : テスト名に「::」区切りパターンを使用しない |
パブリック メソッド
キャンセル
public void cancel ()
テスト実行のキャンセルをリクエストします。
done
public void done ()
adb セッションが完了したときに親から呼び出されます。
getFailedTests
publicgetFailedTests ()
現在のテスト実行中に失敗したテストのリストを返します。
戻り値 | |
---|---|
|
getPrependFileName
public boolean getPrependFileName ()
戻り値 | |
---|---|
boolean |
isCancelled
public boolean isCancelled ()
テスト実行がキャンセルされた場合は true を返します。
戻り値 | |
---|---|
boolean |
isTestRunIncomplete
public boolean isTestRunIncomplete ()
テスト実行が完了したかどうか。
戻り値 | |
---|---|
boolean |
解析の問題やクラッシュが原因でテスト実行が完了しなかった場合は true。 |
processNewLines
public void processNewLines (String[] lines)
パラメータ | |
---|---|
lines |
String |
setPrependFileName
public void setPrependFileName (boolean prepend)
パラメータ | |
---|---|
prepend |
boolean |
保護されたメソッド
isUnexpectedTestFound
protected boolean isUnexpectedTestFound ()
単体テスト用に公開されています。
戻り値 | |
---|---|
boolean |