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

Unified Diff: base/test/launcher/unit_test_launcher.h

Issue 885443002: Roll Chrome into Mojo. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Rebase to ToT mojo Created 5 years, 11 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/test/launcher/test_launcher_ios.cc ('k') | base/test/launcher/unit_test_launcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/test/launcher/unit_test_launcher.h
diff --git a/base/test/launcher/unit_test_launcher.h b/base/test/launcher/unit_test_launcher.h
index 0f661dbcfcfb51e5ba01898595e23ac2d1a69c20..e4997a026f7e3d2f9c9baa11a87956eb3380cad8 100644
--- a/base/test/launcher/unit_test_launcher.h
+++ b/base/test/launcher/unit_test_launcher.h
@@ -33,10 +33,38 @@ int LaunchUnitTests(int argc,
const RunTestSuiteCallback& run_test_suite);
#endif // defined(OS_WIN)
+// Delegate to abstract away platform differences for unit tests.
+class UnitTestPlatformDelegate {
+ public:
+ // Called to get names of tests available for running. The delegate
+ // must put the result in |output| and return true on success.
+ virtual bool GetTests(std::vector<SplitTestName>* output) = 0;
+
+ // Called to create a temporary file. The delegate must put the resulting
+ // path in |path| and return true on success.
+ virtual bool CreateTemporaryFile(base::FilePath* path) = 0;
+
+ // Returns command line for child GTest process based on the command line
+ // of current process. |test_names| is a vector of test full names
+ // (e.g. "A.B"), |output_file| is path to the GTest XML output file.
+ virtual CommandLine GetCommandLineForChildGTestProcess(
+ const std::vector<std::string>& test_names,
+ const base::FilePath& output_file) = 0;
+
+ // Returns wrapper to use for child GTest process. Empty string means
+ // no wrapper.
+ virtual std::string GetWrapperForChildGTestProcess() = 0;
+
+ protected:
+ ~UnitTestPlatformDelegate() {}
+};
+
// Test launcher delegate for unit tests (mostly to support batching).
class UnitTestLauncherDelegate : public TestLauncherDelegate {
public:
- explicit UnitTestLauncherDelegate(size_t batch_limit, bool use_job_objects);
+ UnitTestLauncherDelegate(UnitTestPlatformDelegate* delegate,
+ size_t batch_limit,
+ bool use_job_objects);
~UnitTestLauncherDelegate() override;
private:
@@ -93,6 +121,8 @@ class UnitTestLauncherDelegate : public TestLauncherDelegate {
ThreadChecker thread_checker_;
+ UnitTestPlatformDelegate* platform_delegate_;
+
// Maximum number of tests to run in a single batch.
size_t batch_limit_;
« no previous file with comments | « base/test/launcher/test_launcher_ios.cc ('k') | base/test/launcher/unit_test_launcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698