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

Unified Diff: base/test/test_launcher.h

Issue 16820008: GTTF: Move core parts of test_launcher down to base. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: compile Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/base.gyp ('k') | base/test/test_launcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/test/test_launcher.h
diff --git a/base/test/test_launcher.h b/base/test/test_launcher.h
new file mode 100644
index 0000000000000000000000000000000000000000..720c74c2ca10a669f4308b2a26f91736abcf0315
--- /dev/null
+++ b/base/test/test_launcher.h
@@ -0,0 +1,52 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BASE_TEST_TEST_LAUNCHER_H_
+#define BASE_TEST_TEST_LAUNCHER_H_
+
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+
+namespace testing {
+class TestCase;
+class TestInfo;
+}
+
+namespace base {
+
+// Constants for GTest command-line flags.
+extern const char kGTestFilterFlag[];
+extern const char kGTestListTestsFlag[];
+extern const char kGTestRepeatFlag[];
+extern const char kGTestRunDisabledTestsFlag[];
+extern const char kGTestOutputFlag[];
+
+// Interface for use with LaunchTests that abstracts away exact details
+// which tests and how are run.
+class TestLauncherDelegate {
+ public:
+ // Called before a test is considered for running. If it returns false,
+ // the test is not run. If it returns true, the test will be run provided
+ // it is part of the current shard.
+ virtual bool ShouldRunTest(const testing::TestCase* test_case,
+ const testing::TestInfo* test_info) = 0;
+
+ // Called to make the delegate run specified test. Should return true
+ // on success.
+ virtual bool RunTest(const testing::TestCase* test_case,
+ const testing::TestInfo* test_info) = 0;
+
+ protected:
+ virtual ~TestLauncherDelegate();
+};
+
+// Launches GTest-based tests from the current executable
+// using |launcher_delegate|.
+int LaunchTests(TestLauncherDelegate* launcher_delegate,
+ int argc,
+ char** argv) WARN_UNUSED_RESULT;
+
+} // namespace base
+
+#endif // BASE_TEST_TEST_LAUNCHER_H_
« no previous file with comments | « base/base.gyp ('k') | base/test/test_launcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698