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

Side by Side Diff: base/test/launcher/test_id.cc

Issue 1027993002: Allow unit tests to force serial execution in the test launcher. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: TestID experiment Created 5 years, 9 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 unified diff | Download patch
« no previous file with comments | « base/test/launcher/test_id.h ('k') | base/test/launcher/unit_test_launcher.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "base/test/launcher/test_id.h"
6
7 #include "base/strings/string_util.h"
8
9 namespace base {
10
11 TestID::TestID(const std::string& original_name)
12 : original_name_(original_name) {
13 }
14
15 std::string TestID::GetDisplayName() const {
16 std::string display_name = original_name_;
17 ReplaceFirstSubstringAfterOffset(&display_name, 0, ".DISABLED_", ".");
18 ReplaceFirstSubstringAfterOffset(&display_name, 0, ".SERIALIZE_", ".");
19 return display_name;
20 }
21
22 std::string TestID::GetTestName() const {
23 std::string display_name = GetDisplayName();
24 size_t dot_index = display_name.find('.');
25 return display_name.substr(dot_index + 1);
26 }
27
28 std::string GetTestCaseName() const {
29 size_t dot_index = original_name_.find('.');
30 return original_name_.substr(0, dot_index);
31 }
32
33 bool TestID::IsDisabled() const {
34 return original_name_.find(".DISABLED_") != std::string::npos;
35 }
36
37 bool TestID::IsSerialized() const {
38 return original_name_.find(".SERIALIZE_") != std::string::npos;
39 }
40
41 } // namespace base
42
43 #endif // BASE_TEST_LAUNCHER_TEST_RESULT_H_
OLDNEW
« no previous file with comments | « base/test/launcher/test_id.h ('k') | base/test/launcher/unit_test_launcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698