OLD | NEW |
(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 #ifndef BASE_TEST_TEST_LAUNCHER_H_ |
| 6 #define BASE_TEST_TEST_LAUNCHER_H_ |
| 7 |
| 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" |
| 10 |
| 11 namespace testing { |
| 12 class TestCase; |
| 13 class TestInfo; |
| 14 } |
| 15 |
| 16 namespace base { |
| 17 |
| 18 // Constants for GTest command-line flags. |
| 19 extern const char kGTestFilterFlag[]; |
| 20 extern const char kGTestListTestsFlag[]; |
| 21 extern const char kGTestRepeatFlag[]; |
| 22 extern const char kGTestRunDisabledTestsFlag[]; |
| 23 extern const char kGTestOutputFlag[]; |
| 24 |
| 25 // Interface for use with LaunchTests that abstracts away exact details |
| 26 // which tests and how are run. |
| 27 class TestLauncherDelegate { |
| 28 public: |
| 29 // Called before a test is considered for running. If it returns false, |
| 30 // the test is not run. If it returns true, the test will be run provided |
| 31 // it is part of the current shard. |
| 32 virtual bool ShouldRunTest(const testing::TestCase* test_case, |
| 33 const testing::TestInfo* test_info) = 0; |
| 34 |
| 35 // Called to make the delegate run specified test. Should return true |
| 36 // on success. |
| 37 virtual bool RunTest(const testing::TestCase* test_case, |
| 38 const testing::TestInfo* test_info) = 0; |
| 39 |
| 40 protected: |
| 41 virtual ~TestLauncherDelegate(); |
| 42 }; |
| 43 |
| 44 // Launches GTest-based tests from the current executable |
| 45 // using |launcher_delegate|. |
| 46 int LaunchTests(TestLauncherDelegate* launcher_delegate, |
| 47 int argc, |
| 48 char** argv) WARN_UNUSED_RESULT; |
| 49 |
| 50 } // namespace base |
| 51 |
| 52 #endif // BASE_TEST_TEST_LAUNCHER_H_ |
OLD | NEW |