GTestResultParser

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 ()

एडीबी सत्र पूरा होने पर अभिभावक द्वारा कॉल किया जाता है।

getFailedTests ()

वर्तमान परीक्षण के दौरान विफल हुए परीक्षणों की सूची लौटाता है।

boolean getPrependFileName ()
boolean isCancelled ()

यदि टेस्ट रन रद्द हो जाता है तो यह सत्य लौटाता है।

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 : जैसे-जैसे परीक्षण क्रियान्वित हो रहे हैं, परीक्षण परिणामों की जानकारी दी जाएगी

सार्वजनिक तरीके

रद्द करना

public void cancel ()

परीक्षण चलाने को रद्द करने का अनुरोध.

हो गया

public void done ()

एडीबी सत्र पूरा होने पर अभिभावक द्वारा कॉल किया जाता है।

असफल परीक्षण प्राप्त करें

public  getFailedTests ()

वर्तमान परीक्षण के दौरान विफल हुए परीक्षणों की सूची लौटाता है।

रिटर्न

getPrependFileName

public boolean getPrependFileName ()

रिटर्न
boolean

रद्द कर दिया है

public boolean isCancelled ()

यदि टेस्ट रन रद्द हो जाता है तो यह सत्य लौटाता है।

रिटर्न
boolean

यह सभी देखें:

TestRunअपूर्ण है

public boolean isTestRunIncomplete ()

टेस्ट रन अधूरा था या नहीं.

रिटर्न
boolean सच है, यदि पार्सिंग समस्याओं या क्रैश के कारण परीक्षण अधूरा था।

प्रोसेसन्यूलाइन्स

public void processNewLines (String[] lines)

पैरामीटर
lines String

setPrependFileName

public void setPrependFileName (boolean prepend)

पैरामीटर
prepend boolean

संरक्षित तरीके

अनएक्सपेक्टेडटेस्टफाउंड है

protected boolean isUnexpectedTestFound ()

इकाई परीक्षण के लिए प्रस्तुत किया गया।

रिटर्न
boolean