blob: 44dd764ae24d3dfb863f6ec134a4d693e8dd030f [file] [log] [blame]
Artem Titov40a7a352018-10-15 15:25:34 +02001/*
2 * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10#ifndef TEST_TEST_MAIN_LIB_H_
11#define TEST_TEST_MAIN_LIB_H_
12
13#include <memory>
14
15namespace webrtc {
16
17// Class to initialize test environment and run tests.
18class TestMain {
19 public:
20 virtual ~TestMain() {}
21
22 static std::unique_ptr<TestMain> Create();
23
24 // Initializes test environment. Clients can add their own initialization
25 // steps after call to this method and before running tests.
26 // Returns 0 if initialization was successful and non 0 otherwise.
Artem Titovb5541a02018-10-17 17:37:47 +020027 virtual int Init(int* argc, char* argv[]) = 0;
Artem Titov40a7a352018-10-15 15:25:34 +020028
29 // Runs test end return result error code. 0 - no errors.
30 virtual int Run(int argc, char* argv[]) = 0;
31
32 protected:
33 TestMain() = default;
34};
35
36} // namespace webrtc
37
38#endif // TEST_TEST_MAIN_LIB_H_