1 // Copyright (c) 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.
5 #ifndef BASE_TEST_EXPECTATIONS_EXPECTATION_H_
6 #define BASE_TEST_EXPECTATIONS_EXPECTATION_H_
11 #include "base/base_export.h"
12 #include "base/compiler_specific.h"
13 #include "base/strings/string_piece.h"
15 namespace test_expectations
{
17 // A Result is the expectation of a test's behavior.
19 // The test has a failing assertion.
22 // The test does not complete within the test runner's alloted duration.
25 // The test crashes during the course of its execution.
28 // The test should not be run ever.
31 // The test passes, used to override a more general expectation.
35 // Converts a text string form of a |result| to its enum value, written to
36 // |out_result|. Returns true on success and false on error.
37 bool ResultFromString(const base::StringPiece
& result
,
38 Result
* out_result
) WARN_UNUSED_RESULT
;
40 // A Platform stores information about the OS environment.
42 // The name of the platform. E.g., "Win", or "Mac".
45 // The variant of the platform, either an OS version like "XP" or "10.8", or
46 // "Device" or "Simulator" in the case of mobile.
50 // Converts a text string |modifier| to a Platform struct, written to
51 // |out_platform|. Returns true on success and false on failure.
52 bool PlatformFromString(const base::StringPiece
& modifier
,
53 Platform
* out_platform
) WARN_UNUSED_RESULT
;
55 // Returns the Platform for the currently running binary.
56 Platform
GetCurrentPlatform();
58 // The build configuration.
60 CONFIGURATION_UNSPECIFIED
,
62 CONFIGURATION_RELEASE
,
65 // Converts the |modifier| to a Configuration constant, writing the value to
66 // |out_configuration|. Returns true on success or false on failure.
67 bool ConfigurationFromString(const base::StringPiece
& modifier
,
68 Configuration
* out_configuration
) WARN_UNUSED_RESULT
;
70 // Returns the Configuration for the currently running binary.
71 Configuration
GetCurrentConfiguration();
73 // An Expectation is records what the result for a given test name should be on
74 // the specified platforms and configuration.
79 // The name of the test, like FooBarTest.BarIsBaz.
80 std::string test_name
;
82 // The set of platforms for which this expectation is applicable.
83 std::vector
<Platform
> platforms
;
85 // The build configuration.
86 Configuration configuration
;
88 // The expected result of this test.
92 } // namespace test_expectations
94 #endif // BASE_TEST_EXPECTATIONS_EXPECTATION_H_