blob: 4b27f9f2c32a34e07dcfa4fa31e6f39ccc7cfaa6 [file] [log] [blame]
andrew@webrtc.org14b43be2012-10-22 18:19:23 +00001/*
2 * Copyright (c) 2011 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
andrew@webrtc.orgb87cc852013-03-25 16:23:37 +000011#ifndef WEBRTC_TEST_TEST_SUITE_H_
12#define WEBRTC_TEST_TEST_SUITE_H_
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000013
14// Derived from Chromium's src/base/test/test_suite.h.
15
16// Defines a basic test suite framework for running gtest based tests. You can
17// instantiate this class in your main function and call its Run method to run
18// any gtest based tests that are linked into your executable.
19
kwibergbfefb032016-05-01 14:53:46 -070020#include <memory>
21
henrike@webrtc.org88fbb2d2014-05-21 21:18:46 +000022#include "webrtc/base/constructormagic.h"
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000023
24namespace webrtc {
25namespace test {
andrew@webrtc.orgc1ffd332013-03-22 17:13:23 +000026
andrew@webrtc.orgb87cc852013-03-25 16:23:37 +000027class TraceToStderr;
andrew@webrtc.orgc1ffd332013-03-22 17:13:23 +000028
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000029class TestSuite {
30 public:
31 TestSuite(int argc, char** argv);
32 virtual ~TestSuite();
33
34 int Run();
35
36 protected:
37 // Override these for custom initialization and shutdown handling. Use these
38 // instead of putting complex code in your constructor/destructor.
39 virtual void Initialize();
40 virtual void Shutdown();
41
henrikg3c089d72015-09-16 05:37:44 -070042 RTC_DISALLOW_COPY_AND_ASSIGN(TestSuite);
andrew@webrtc.orgc1ffd332013-03-22 17:13:23 +000043
44 private:
kwibergbfefb032016-05-01 14:53:46 -070045 std::unique_ptr<TraceToStderr> trace_to_stderr_;
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000046};
andrew@webrtc.orgc1ffd332013-03-22 17:13:23 +000047
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000048} // namespace test
49} // namespace webrtc
50
51#endif // TEST_TEST_SUITE_H_