| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef BASE_TEST_LAUNCHER_TEST_RESULTS_TRACKER_H_ | 5 #ifndef BASE_TEST_LAUNCHER_TEST_RESULTS_TRACKER_H_ |
| 6 #define BASE_TEST_LAUNCHER_TEST_RESULTS_TRACKER_H_ | 6 #define BASE_TEST_LAUNCHER_TEST_RESULTS_TRACKER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 TestResultsTracker(); | 34 TestResultsTracker(); |
| 35 ~TestResultsTracker(); | 35 ~TestResultsTracker(); |
| 36 | 36 |
| 37 // Initialize the result tracker. Must be called exactly once before | 37 // Initialize the result tracker. Must be called exactly once before |
| 38 // calling any other methods. Returns true on success. | 38 // calling any other methods. Returns true on success. |
| 39 bool Init(const CommandLine& command_line) WARN_UNUSED_RESULT; | 39 bool Init(const CommandLine& command_line) WARN_UNUSED_RESULT; |
| 40 | 40 |
| 41 // Called when a test iteration is starting. | 41 // Called when a test iteration is starting. |
| 42 void OnTestIterationStarting(); | 42 void OnTestIterationStarting(); |
| 43 | 43 |
| 44 // Adds |test_name| to the set of discovered tests (this includes all tests |
| 45 // present in the executable, not necessarily run). |
| 46 void AddTest(const std::string& test_name); |
| 47 |
| 48 // Adds |test_name| to the set of disabled tests. |
| 49 void AddDisabledTest(const std::string& test_name); |
| 50 |
| 44 // Adds |result| to the stored test results. | 51 // Adds |result| to the stored test results. |
| 45 void AddTestResult(const TestResult& result); | 52 void AddTestResult(const TestResult& result); |
| 46 | 53 |
| 47 // Prints a summary of current test iteration to stdout. | 54 // Prints a summary of current test iteration to stdout. |
| 48 void PrintSummaryOfCurrentIteration() const; | 55 void PrintSummaryOfCurrentIteration() const; |
| 49 | 56 |
| 50 // Prints a summary of all test iterations (not just the last one) to stdout. | 57 // Prints a summary of all test iterations (not just the last one) to stdout. |
| 51 void PrintSummaryOfAllIterations() const; | 58 void PrintSummaryOfAllIterations() const; |
| 52 | 59 |
| 53 // Adds a string tag to the JSON summary. This is intended to indicate | 60 // Adds a string tag to the JSON summary. This is intended to indicate |
| (...skipping 20 matching lines...) Expand all Loading... |
| 74 typedef std::map<std::string, AggregateTestResult> ResultsMap; | 81 typedef std::map<std::string, AggregateTestResult> ResultsMap; |
| 75 ResultsMap results; | 82 ResultsMap results; |
| 76 }; | 83 }; |
| 77 | 84 |
| 78 ThreadChecker thread_checker_; | 85 ThreadChecker thread_checker_; |
| 79 | 86 |
| 80 // Set of global tags, i.e. strings indicating conditions that apply to | 87 // Set of global tags, i.e. strings indicating conditions that apply to |
| 81 // the entire test run. | 88 // the entire test run. |
| 82 std::set<std::string> global_tags_; | 89 std::set<std::string> global_tags_; |
| 83 | 90 |
| 91 // Set of all test names discovered in the current executable. |
| 92 std::set<std::string> all_tests_; |
| 93 |
| 94 // Set of all disabled tests in the current executable. |
| 95 std::set<std::string> disabled_tests_; |
| 96 |
| 84 // Store test results for each iteration. | 97 // Store test results for each iteration. |
| 85 std::vector<PerIterationData> per_iteration_data_; | 98 std::vector<PerIterationData> per_iteration_data_; |
| 86 | 99 |
| 87 // Index of current iteration (starting from 0). -1 before the first | 100 // Index of current iteration (starting from 0). -1 before the first |
| 88 // iteration. | 101 // iteration. |
| 89 int iteration_; | 102 int iteration_; |
| 90 | 103 |
| 91 // File handle of output file (can be NULL if no file). | 104 // File handle of output file (can be NULL if no file). |
| 92 FILE* out_; | 105 FILE* out_; |
| 93 | 106 |
| 94 DISALLOW_COPY_AND_ASSIGN(TestResultsTracker); | 107 DISALLOW_COPY_AND_ASSIGN(TestResultsTracker); |
| 95 }; | 108 }; |
| 96 | 109 |
| 97 } // namespace base | 110 } // namespace base |
| 98 | 111 |
| 99 #endif // BASE_TEST_LAUNCHER_TEST_RESULTS_TRACKER_H_ | 112 #endif // BASE_TEST_LAUNCHER_TEST_RESULTS_TRACKER_H_ |
| OLD | NEW |