GTestResult파서
public class GTestResultParser
extends MultiLineReceiver
java.lang.객체 | ||
↳ | 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, listeners) GTestResultParser (String testRunName, listeners) GTestResultParser를 생성합니다. |
공개 방법 | |
---|---|
void | cancel () 테스트 실행 취소를 요청합니다. |
void | done () adb 세션이 완료되면 부모가 호출합니다. |
boolean | getPrependFileName () |
boolean | isCancelled () 테스트 실행이 취소되면 true를 반환합니다. |
void | processNewLines (String[] lines) |
void | setPrependFileName (boolean prepend) |
공개 생성자
GTestResult파서
public GTestResultParser (String testRunName,listeners)
GTestResultParser를 생성합니다.
매개변수 | |
---|---|
testRunName | String : ITestLifeCycleReceiver.testRunStarted(String, int) 에 제공할 테스트 실행 이름 |
listeners |
공개 방법
취소
public void cancel ()
테스트 실행 취소를 요청합니다.
완료
public void done ()
adb 세션이 완료되면 부모가 호출합니다.
getPrependFileName
public boolean getPrependFileName ()
보고 | |
---|---|
boolean |
취소됨
public boolean isCancelled ()
테스트 실행이 취소되면 true를 반환합니다.
보고 | |
---|---|
boolean |
processNewLines
public void processNewLines (String[] lines)
매개변수 | |
---|---|
lines | String |
setPrependFileName
public void setPrependFileName (boolean prepend)
매개변수 | |
---|---|
prepend | boolean |