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 #include "base/test/launcher/unit_test_launcher.h" | 5 #include "base/test/launcher/unit_test_launcher.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 DCHECK(thread_checker_.CalledOnValidThread()); | 110 DCHECK(thread_checker_.CalledOnValidThread()); |
111 } | 111 } |
112 | 112 |
113 private: | 113 private: |
114 struct GTestCallbackState { | 114 struct GTestCallbackState { |
115 TestLauncher* test_launcher; | 115 TestLauncher* test_launcher; |
116 std::vector<std::string> test_names; | 116 std::vector<std::string> test_names; |
117 FilePath output_file; | 117 FilePath output_file; |
118 }; | 118 }; |
119 | 119 |
120 virtual void OnTestIterationStarting() OVERRIDE { | |
121 // Nothing to do. | |
122 } | |
123 | |
124 virtual std::string GetTestNameForFiltering( | |
125 const testing::TestCase* test_case, | |
126 const testing::TestInfo* test_info) OVERRIDE { | |
127 DCHECK(thread_checker_.CalledOnValidThread()); | |
128 | |
129 return std::string(test_case->name()) + "." + test_info->name(); | |
130 } | |
131 | |
132 virtual bool ShouldRunTest(const testing::TestCase* test_case, | 120 virtual bool ShouldRunTest(const testing::TestCase* test_case, |
133 const testing::TestInfo* test_info) OVERRIDE { | 121 const testing::TestInfo* test_info) OVERRIDE { |
134 DCHECK(thread_checker_.CalledOnValidThread()); | 122 DCHECK(thread_checker_.CalledOnValidThread()); |
135 | 123 |
136 // There is no additional logic to disable specific tests. | 124 // There is no additional logic to disable specific tests. |
137 return true; | 125 return true; |
138 } | 126 } |
139 | 127 |
140 virtual size_t RunTests(TestLauncher* test_launcher, | 128 virtual size_t RunTests(TestLauncher* test_launcher, |
141 const std::vector<std::string>& test_names) OVERRIDE { | 129 const std::vector<std::string>& test_names) OVERRIDE { |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 argc, argv, run_test_suite, SysInfo::NumberOfProcessors()); | 539 argc, argv, run_test_suite, SysInfo::NumberOfProcessors()); |
552 } | 540 } |
553 | 541 |
554 int LaunchUnitTestsSerially(int argc, | 542 int LaunchUnitTestsSerially(int argc, |
555 char** argv, | 543 char** argv, |
556 const RunTestSuiteCallback& run_test_suite) { | 544 const RunTestSuiteCallback& run_test_suite) { |
557 return LaunchUnitTestsInternal(argc, argv, run_test_suite, 1); | 545 return LaunchUnitTestsInternal(argc, argv, run_test_suite, 1); |
558 } | 546 } |
559 | 547 |
560 } // namespace base | 548 } // namespace base |
OLD | NEW |