13551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// Copyright 2013 The Chromium Authors. All rights reserved.
23551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
33551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// found in the LICENSE file.
43551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)
54e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)#ifndef BASE_TEST_LAUNCHER_UNIT_TEST_LAUNCHER_H_
64e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)#define BASE_TEST_LAUNCHER_UNIT_TEST_LAUNCHER_H_
73551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)
83551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)#include "base/callback.h"
93551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)
103551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)namespace base {
113551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)
123551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// Callback that runs a test suite and returns exit code.
133551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)typedef base::Callback<int(void)> RunTestSuiteCallback;
143551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)
153551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// Launches unit tests in given test suite. Returns exit code.
163551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)int LaunchUnitTests(int argc,
173551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)                    char** argv,
183551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)                    const RunTestSuiteCallback& run_test_suite);
193551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)
20a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)// Same as above, but always runs tests serially.
21a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)int LaunchUnitTestsSerially(int argc,
22a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)                            char** argv,
23a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)                            const RunTestSuiteCallback& run_test_suite);
24a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)
25f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles)#if defined(OS_WIN)
26f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles)// Launches unit tests in given test suite. Returns exit code.
27f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles)// |use_job_objects| determines whether to use job objects.
28f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles)int LaunchUnitTests(int argc,
29f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles)                    wchar_t** argv,
30f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles)                    bool use_job_objects,
31f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles)                    const RunTestSuiteCallback& run_test_suite);
32f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles)#endif  // defined(OS_WIN)
33f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles)
343551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)}   // namespace base
353551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)
364e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)#endif  // BASE_TEST_LAUNCHER_UNIT_TEST_LAUNCHER_H_
37