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

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

Issue 1647803004: Move base to DEPS (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 10 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_result.h ('k') | base/test/launcher/test_results_tracker.h » ('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 2013 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_result.h"
6
7 #include "base/logging.h"
8
9 namespace base {
10
11 TestResult::TestResult() : status(TEST_UNKNOWN) {
12 }
13
14 TestResult::~TestResult() {
15 }
16
17 std::string TestResult::StatusAsString() const {
18 switch (status) {
19 case TEST_UNKNOWN:
20 return "UNKNOWN";
21 case TEST_SUCCESS:
22 return "SUCCESS";
23 case TEST_FAILURE:
24 return "FAILURE";
25 case TEST_FAILURE_ON_EXIT:
26 return "FAILURE_ON_EXIT";
27 case TEST_CRASH:
28 return "CRASH";
29 case TEST_TIMEOUT:
30 return "TIMEOUT";
31 case TEST_SKIPPED:
32 return "SKIPPED";
33 // Rely on compiler warnings to ensure all possible values are handled.
34 }
35
36 NOTREACHED();
37 return std::string();
38 }
39
40 std::string TestResult::GetTestName() const {
41 size_t dot_pos = full_name.find('.');
42 CHECK_NE(dot_pos, std::string::npos);
43 return full_name.substr(dot_pos + 1);
44 }
45
46 std::string TestResult::GetTestCaseName() const {
47 size_t dot_pos = full_name.find('.');
48 CHECK_NE(dot_pos, std::string::npos);
49 return full_name.substr(0, dot_pos);
50 }
51
52 } // namespace base
OLDNEW
« no previous file with comments | « base/test/launcher/test_result.h ('k') | base/test/launcher/test_results_tracker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698