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 |