Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(193)

Unified Diff: base/test/launcher/test_result.h

Issue 2606153003: Report failed expect/assert to test launcher summary output. (Closed)
Patch Set: Always provide unencoded summary. Created 3 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/test/gtest_xml_util.cc ('k') | base/test/launcher/test_result.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/test/launcher/test_result.h
diff --git a/base/test/launcher/test_result.h b/base/test/launcher/test_result.h
index 19c6ba5cfc9edb8a96ad4c7d0e8e00cc1623e352..07338b372f6dff1cc251e39247f0c80832ba0e05 100644
--- a/base/test/launcher/test_result.h
+++ b/base/test/launcher/test_result.h
@@ -6,11 +6,44 @@
#define BASE_TEST_LAUNCHER_TEST_RESULT_H_
#include <string>
+#include <vector>
#include "base/time/time.h"
namespace base {
+// Structure contains result of a single EXPECT/ASSERT/SUCCESS.
+struct TestResultPart {
+ enum Type {
+ kSuccess, // SUCCESS
+ kNonFatalFailure, // EXPECT
+ kFatalFailure, // ASSERT
+ };
+ Type type;
+
+ TestResultPart();
+ ~TestResultPart();
+
+ TestResultPart(const TestResultPart& other);
+ TestResultPart(TestResultPart&& other);
+ TestResultPart& operator=(const TestResultPart& other);
+ TestResultPart& operator=(TestResultPart&& other);
+
+ // Convert type to string and back.
+ static bool TypeFromString(const std::string& str, Type* type);
+ std::string TypeAsString() const;
+
+ // Filename and line of EXPECT/ASSERT.
+ std::string file_name;
+ int line_number;
+
+ // Message without stacktrace, etc.
+ std::string summary;
+
+ // Complete message.
+ std::string message;
+};
+
// Structure containing result of a single test.
struct TestResult {
enum Status {
@@ -27,6 +60,11 @@ struct TestResult {
TestResult();
~TestResult();
+ TestResult(const TestResult& other);
+ TestResult(TestResult&& other);
+ TestResult& operator=(const TestResult& other);
+ TestResult& operator=(TestResult&& other);
+
// Returns the test status as string (e.g. for display).
std::string StatusAsString() const;
@@ -56,6 +94,9 @@ struct TestResult {
// Output of just this test (optional).
std::string output_snippet;
+
+ // Information about failed expectations.
+ std::vector<TestResultPart> test_result_parts;
};
} // namespace base
« no previous file with comments | « base/test/gtest_xml_util.cc ('k') | base/test/launcher/test_result.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698