OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <string> | 5 #include <string> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/hash_tables.h" | 10 #include "base/hash_tables.h" |
11 #include "base/linked_ptr.h" | 11 #include "base/linked_ptr.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 // Only each test (testcase element in the XML) will have the correct | 83 // Only each test (testcase element in the XML) will have the correct |
84 // failed/disabled/elapsed_time information. Each test won't include | 84 // failed/disabled/elapsed_time information. Each test won't include |
85 // detailed failure messages either. | 85 // detailed failure messages either. |
86 class ResultsPrinter { | 86 class ResultsPrinter { |
87 public: | 87 public: |
88 explicit ResultsPrinter(const CommandLine& command_line); | 88 explicit ResultsPrinter(const CommandLine& command_line); |
89 ~ResultsPrinter(); | 89 ~ResultsPrinter(); |
90 void OnTestCaseStart(const char* name, int test_count) const; | 90 void OnTestCaseStart(const char* name, int test_count) const; |
91 void OnTestCaseEnd() const; | 91 void OnTestCaseEnd() const; |
92 | 92 |
93 // TODO(phajdan.jr): Convert bool failed, bool failure_ignored to an enum. | |
94 void OnTestEnd(const char* name, const char* case_name, bool run, | 93 void OnTestEnd(const char* name, const char* case_name, bool run, |
95 bool failed, bool failure_ignored, double elapsed_time) const; | 94 bool failed, bool failure_ignored, double elapsed_time) const; |
96 private: | 95 private: |
97 FILE* out_; | 96 FILE* out_; |
98 | 97 |
99 DISALLOW_COPY_AND_ASSIGN(ResultsPrinter); | 98 DISALLOW_COPY_AND_ASSIGN(ResultsPrinter); |
100 }; | 99 }; |
101 | 100 |
102 ResultsPrinter::ResultsPrinter(const CommandLine& command_line) : out_(NULL) { | 101 ResultsPrinter::ResultsPrinter(const CommandLine& command_line) : out_(NULL) { |
103 if (!command_line.HasSwitch(kGTestOutputFlag)) | 102 if (!command_line.HasSwitch(kGTestOutputFlag)) |
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
537 exit_code = 1; | 536 exit_code = 1; |
538 break; | 537 break; |
539 } | 538 } |
540 | 539 |
541 // Special value "-1" means "repeat indefinitely". | 540 // Special value "-1" means "repeat indefinitely". |
542 if (cycles != -1) | 541 if (cycles != -1) |
543 cycles--; | 542 cycles--; |
544 } | 543 } |
545 return exit_code; | 544 return exit_code; |
546 } | 545 } |
OLD | NEW |