GTestResultParser
public class GTestResultParser
extends MultiLineReceiver
java.lang.Object | ||
↳ | com.android.ddmlib.MultiLineReceiver | |
↳ | com.android.tradefed.testtype.GTestResultParser |
Kabuktan çalıştırılan GTest'i kullanarak yerel testlerin 'ham çıktı modu' sonuçlarını ayrıştırır ve sonuçları bir ITestInvokasyonListener'a bildirir.
Beklenen çıktının örnek formatı:
[==========] 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
burada belirli olayları bildirmek için aşağıdaki etiketler kullanılır:
[==========]: 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)Diğer tüm satırlar dikkate alınmaz.
Özet
Kamu inşaatçıları | |
---|---|
GTestResultParser (String testRunName, listeners) GTestResultParser (String testRunName, listeners) GTestResultParser'ı oluşturur. |
Genel yöntemler | |
---|---|
void | cancel () Test çalıştırmasının iptalini talep ediyor. |
void | done () Adb oturumu tamamlandığında ebeveyn tarafından çağrılır. |
getFailedTests () Geçerli test çalıştırması sırasında başarısız olan testlerin listesini döndürür. | |
boolean | getPrependFileName () |
boolean | isCancelled () Test çalıştırması iptal edilirse true değerini döndürür. |
boolean | isTestRunIncomplete () Test çalıştırmasının eksik olup olmadığı. |
void | processNewLines (String[] lines) |
void | setPrependFileName (boolean prepend) |
Korumalı yöntemler | |
---|---|
boolean | isUnexpectedTestFound () Birim testi için kullanıma sunuldu. |
Kamu inşaatçıları
GTestResultParser
public GTestResultParser (String testRunName,listeners)
GTestResultParser'ı oluşturur.
Parametreler | |
---|---|
testRunName | String : ITestLifeCycleReceiver.testRunStarted(String, int) öğesine sağlanacak test çalıştırması adı |
listeners |
Genel yöntemler
iptal etmek
public void cancel ()
Test çalıştırmasının iptalini talep ediyor.
Tamamlandı
public void done ()
Adb oturumu tamamlandığında ebeveyn tarafından çağrılır.
getFailedTestler
publicgetFailedTests ()
Geçerli test çalıştırması sırasında başarısız olan testlerin listesini döndürür.
İadeler | |
---|---|
getPrependFileName
public boolean getPrependFileName ()
İadeler | |
---|---|
boolean |
iptal edildi
public boolean isCancelled ()
Test çalıştırması iptal edilirse true değerini döndürür.
İadeler | |
---|---|
boolean |
Ayrıca bakınız:
isTestRunIncomplete
public boolean isTestRunIncomplete ()
Test çalıştırmasının eksik olup olmadığı.
İadeler | |
---|---|
boolean | doğru, test çalıştırması ayrıştırma sorunları veya çökmeler nedeniyle tamamlanmamışsa. |
süreçYeni Hatlar
public void processNewLines (String[] lines)
Parametreler | |
---|---|
lines | String |
setPrependDosyaAdı
public void setPrependFileName (boolean prepend)
Parametreler | |
---|---|
prepend | boolean |
Korumalı yöntemler
BeklenmedikTestBulundu
protected boolean isUnexpectedTestFound ()
Birim testi için kullanıma sunuldu.
İadeler | |
---|---|
boolean |