blob: 16c03579585daa8ecae1b6f0487481b12a459b37 [file] [log] [blame]
andrew@webrtc.orga7b57da2012-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.orgf6582782013-03-25 16:23:37 +000011#ifndef WEBRTC_TEST_TEST_SUITE_H_
12#define WEBRTC_TEST_TEST_SUITE_H_
andrew@webrtc.orga7b57da2012-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
andrew@webrtc.orgf6582782013-03-25 16:23:37 +000020#include "webrtc/system_wrappers/interface/constructor_magic.h"
21#include "webrtc/system_wrappers/interface/scoped_ptr.h"
andrew@webrtc.orga7b57da2012-10-22 18:19:23 +000022
23namespace webrtc {
24namespace test {
andrew@webrtc.org680fbc52013-03-22 17:13:23 +000025
andrew@webrtc.orgf6582782013-03-25 16:23:37 +000026class TraceToStderr;
andrew@webrtc.org680fbc52013-03-22 17:13:23 +000027
andrew@webrtc.orga7b57da2012-10-22 18:19:23 +000028class TestSuite {
29 public:
30 TestSuite(int argc, char** argv);
31 virtual ~TestSuite();
32
33 int Run();
34
35 protected:
36 // Override these for custom initialization and shutdown handling. Use these
37 // instead of putting complex code in your constructor/destructor.
38 virtual void Initialize();
39 virtual void Shutdown();
40
41 DISALLOW_COPY_AND_ASSIGN(TestSuite);
andrew@webrtc.org680fbc52013-03-22 17:13:23 +000042
43 private:
andrew@webrtc.orgf6582782013-03-25 16:23:37 +000044 scoped_ptr<TraceToStderr> trace_to_stderr_;
andrew@webrtc.orga7b57da2012-10-22 18:19:23 +000045};
andrew@webrtc.org680fbc52013-03-22 17:13:23 +000046
andrew@webrtc.orga7b57da2012-10-22 18:19:23 +000047} // namespace test
48} // namespace webrtc
49
50#endif // TEST_TEST_SUITE_H_