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 |