blob: 04fc845bd99bb1f19421834ee0ca6371eee37ef3 [file] [log] [blame]
mmentovai@google.comaa13be62008-09-03 03:20:34 +09001// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
jeremy@chromium.org0d8eba72008-12-03 04:20:15 +09005#ifndef TESTING_PLATFORM_TEST_H_
6#define TESTING_PLATFORM_TEST_H_
mmentovai@google.comaa13be62008-09-03 03:20:34 +09007
jeremy@chromium.org0d8eba72008-12-03 04:20:15 +09008#include <gtest/gtest.h>
mmentovai@google.comaa13be62008-09-03 03:20:34 +09009
jeremy@chromium.org0d8eba72008-12-03 04:20:15 +090010#if defined(GTEST_OS_MAC)
mmentovai@google.comaa13be62008-09-03 03:20:34 +090011#ifdef __OBJC__
12@class NSAutoreleasePool;
13#else
14class NSAutoreleasePool;
15#endif
16
17// The purpose of this class us to provide a hook for platform-specific
mark@chromium.orgc8cddec2009-08-21 07:37:59 +090018// operations across unit tests. For example, on the Mac, it creates and
19// releases an outer NSAutoreleasePool for each test case. For now, it's only
20// implemented on the Mac. To enable this for another platform, just adjust
21// the #ifdefs and add a platform_test_<platform>.cc implementation file.
mmentovai@google.comaa13be62008-09-03 03:20:34 +090022class PlatformTest : public testing::Test {
lpromero@google.com5e21f7b2012-10-12 01:08:07 +090023 public:
24 virtual ~PlatformTest();
25
maruel@chromium.orge5743442009-03-05 21:46:38 +090026 protected:
mark@chromium.orgc8cddec2009-08-21 07:37:59 +090027 PlatformTest();
mmentovai@google.comaa13be62008-09-03 03:20:34 +090028
29 private:
30 NSAutoreleasePool* pool_;
31};
32#else
33typedef testing::Test PlatformTest;
jeremy@chromium.org0d8eba72008-12-03 04:20:15 +090034#endif // GTEST_OS_MAC
mmentovai@google.comaa13be62008-09-03 03:20:34 +090035
jeremy@chromium.org0d8eba72008-12-03 04:20:15 +090036#endif // TESTING_PLATFORM_TEST_H_