| Index: chrome/browser/diagnostics/diagnostics_main.cc
|
| ===================================================================
|
| --- chrome/browser/diagnostics/diagnostics_main.cc (revision 70409)
|
| +++ chrome/browser/diagnostics/diagnostics_main.cc (working copy)
|
| @@ -1,4 +1,4 @@
|
| -// Copyright (c) 2010 The Chromium Authors. All rights reserved.
|
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| @@ -204,9 +204,14 @@
|
| public:
|
| // The |console| must be valid and properly initialized. This
|
| // class does not own it.
|
| - explicit TestWriter(SimpleConsole* console) : console_(console) {
|
| + explicit TestWriter(SimpleConsole* console)
|
| + : console_(console),
|
| + failures_(0) {
|
| }
|
|
|
| + // How many tests reported failure.
|
| + int failures() { return failures_; }
|
| +
|
| // Write an informational line of text in white over black.
|
| bool WriteInfoText(const std::wstring& txt) {
|
| console_->SetColor(SimpleConsole::DEFAULT);
|
| @@ -224,6 +229,7 @@
|
| } else {
|
| console_->SetColor(SimpleConsole::RED);
|
| console_->Write(L"[FAIL] ");
|
| + failures_++;
|
| }
|
| WriteInfoText(name + L"\n");
|
| std::wstring second_line(L" ");
|
| @@ -235,6 +241,9 @@
|
|
|
| SimpleConsole* console_;
|
|
|
| + // Keeps track of how many tests reported failure.
|
| + int failures_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(TestWriter);
|
| };
|
|
|
| @@ -290,7 +299,12 @@
|
| }
|
|
|
| virtual void OnDoneAll(DiagnosticsModel* model) {
|
| - writer_->WriteInfoText(L"DONE\n\n");
|
| + if (writer_->failures() > 0) {
|
| + writer_->WriteInfoText(StringPrintf(L"DONE. %d failure(s)\n\n",
|
| + writer_->failures()));
|
| + } else {
|
| + writer_->WriteInfoText(L"DONE\n\n");
|
| + }
|
| }
|
|
|
| private:
|
|
|