blob: 2ef305bfa408a5baca1295d51bd60d69cf9d3115 [file] [log] [blame]
andrew@webrtc.org19eefdc2011-09-14 17:02:44 +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#include "webrtc/test/test_suite.h"
andrew@webrtc.orgc1ffd332013-03-22 17:13:23 +000012
13#include "testing/gmock/include/gmock/gmock.h"
14#include "testing/gtest/include/gtest/gtest.h"
andrew@webrtc.orgb87cc852013-03-25 16:23:37 +000015#include "webrtc/test/testsupport/fileutils.h"
16#include "webrtc/test/testsupport/trace_to_stderr.h"
andrew@webrtc.org19eefdc2011-09-14 17:02:44 +000017
18namespace webrtc {
kjellander@webrtc.org20a370e2011-11-04 01:19:16 +000019namespace test {
kjellander@webrtc.org83b767b2012-10-15 18:14:12 +000020
andrew@webrtc.orgc1ffd332013-03-22 17:13:23 +000021TestSuite::TestSuite(int argc, char** argv)
andrew@webrtc.orgb87cc852013-03-25 16:23:37 +000022 : trace_to_stderr_(NULL) {
kjellander@webrtc.org193600b2012-10-17 04:39:44 +000023 SetExecutablePath(argv[0]);
kjellander@webrtc.org20a370e2011-11-04 01:19:16 +000024 testing::InitGoogleMock(&argc, argv); // Runs InitGoogleTest() internally.
andrew@webrtc.org19eefdc2011-09-14 17:02:44 +000025}
26
27TestSuite::~TestSuite() {
28}
29
30int TestSuite::Run() {
31 Initialize();
32 int result = RUN_ALL_TESTS();
33 Shutdown();
34 return result;
35}
36
37void TestSuite::Initialize() {
andrew@webrtc.orgb87cc852013-03-25 16:23:37 +000038 // Create TraceToStderr here so the behavior can be overridden.
39 trace_to_stderr_.reset(new TraceToStderr);
andrew@webrtc.org19eefdc2011-09-14 17:02:44 +000040}
41
42void TestSuite::Shutdown() {
43}
andrew@webrtc.orgc1ffd332013-03-22 17:13:23 +000044
kjellander@webrtc.org20a370e2011-11-04 01:19:16 +000045} // namespace test
andrew@webrtc.org19eefdc2011-09-14 17:02:44 +000046} // namespace webrtc