andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 1 | /* |
| 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.org | b87cc85 | 2013-03-25 16:23:37 +0000 | [diff] [blame] | 11 | #ifndef WEBRTC_TEST_TEST_SUITE_H_ |
| 12 | #define WEBRTC_TEST_TEST_SUITE_H_ |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 13 | |
| 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 | |
kwiberg | bfefb03 | 2016-05-01 14:53:46 -0700 | [diff] [blame] | 20 | #include <memory> |
| 21 | |
henrike@webrtc.org | 88fbb2d | 2014-05-21 21:18:46 +0000 | [diff] [blame] | 22 | #include "webrtc/base/constructormagic.h" |
kwiberg@webrtc.org | 00b8f6b | 2015-02-26 14:34:55 +0000 | [diff] [blame] | 23 | #include "webrtc/base/scoped_ptr.h" |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 24 | |
| 25 | namespace webrtc { |
| 26 | namespace test { |
andrew@webrtc.org | c1ffd33 | 2013-03-22 17:13:23 +0000 | [diff] [blame] | 27 | |
andrew@webrtc.org | b87cc85 | 2013-03-25 16:23:37 +0000 | [diff] [blame] | 28 | class TraceToStderr; |
andrew@webrtc.org | c1ffd33 | 2013-03-22 17:13:23 +0000 | [diff] [blame] | 29 | |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 30 | class TestSuite { |
| 31 | public: |
| 32 | TestSuite(int argc, char** argv); |
| 33 | virtual ~TestSuite(); |
| 34 | |
| 35 | int Run(); |
| 36 | |
| 37 | protected: |
| 38 | // Override these for custom initialization and shutdown handling. Use these |
| 39 | // instead of putting complex code in your constructor/destructor. |
| 40 | virtual void Initialize(); |
| 41 | virtual void Shutdown(); |
| 42 | |
henrikg | 3c089d7 | 2015-09-16 05:37:44 -0700 | [diff] [blame] | 43 | RTC_DISALLOW_COPY_AND_ASSIGN(TestSuite); |
andrew@webrtc.org | c1ffd33 | 2013-03-22 17:13:23 +0000 | [diff] [blame] | 44 | |
| 45 | private: |
kwiberg | bfefb03 | 2016-05-01 14:53:46 -0700 | [diff] [blame] | 46 | std::unique_ptr<TraceToStderr> trace_to_stderr_; |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 47 | }; |
andrew@webrtc.org | c1ffd33 | 2013-03-22 17:13:23 +0000 | [diff] [blame] | 48 | |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 49 | } // namespace test |
| 50 | } // namespace webrtc |
| 51 | |
| 52 | #endif // TEST_TEST_SUITE_H_ |