Index: base/test/gtest_xml_unittest_result_printer.h |
diff --git a/base/test/gtest_xml_unittest_result_printer.h b/base/test/gtest_xml_unittest_result_printer.h |
index cce5e88023a045f0de48486ee35de995a980d3df..fee39e82f30bef74a2eb89c69be25ea3e300af7b 100644 |
--- a/base/test/gtest_xml_unittest_result_printer.h |
+++ b/base/test/gtest_xml_unittest_result_printer.h |
@@ -22,6 +22,19 @@ class XmlUnitTestResultPrinter : public testing::EmptyTestEventListener { |
XmlUnitTestResultPrinter(); |
~XmlUnitTestResultPrinter() override; |
+ // Some tests may contain broken EXPECT with a large message inside a loop |
+ // with several thousands iterations and produce huge output (several |
+ // gigabytes). Limit number of serialized test result parts to prevent it. |
+ // Zero value disables test part results. |
+ // Negative value disables limit. |
+ void set_test_part_results_limit(int limit) { |
Paweł Hajdan Jr.
2017/05/05 17:33:03
Instead of a setter, can we make this class read c
alex-ac
2017/05/07 12:07:24
Done.
|
+ test_part_results_limit_ = limit; |
+ } |
+ int test_part_results_limit() const { return test_part_results_limit_; } |
+ bool has_test_part_results_limit() const { |
+ return test_part_results_limit_ >= 0; |
+ } |
+ |
// Must be called before adding as a listener. Returns true on success. |
bool Initialize(const FilePath& output_file_path) WARN_UNUSED_RESULT; |
@@ -45,6 +58,7 @@ class XmlUnitTestResultPrinter : public testing::EmptyTestEventListener { |
const std::string& message); |
FILE* output_file_; |
+ int test_part_results_limit_; |
DISALLOW_COPY_AND_ASSIGN(XmlUnitTestResultPrinter); |
}; |