From 83663efba46333b95c4143967ac500dd31e08efc Mon Sep 17 00:00:00 2001 From: "andrew@webrtc.org" Date: Tue, 19 Feb 2013 23:43:57 +0000 Subject: [PATCH] Replace gtest_prod.h include with our own FRIEND_TEST macro. This small bit of duplication avoids depending on any part of GTest in production code. TBR=phoglund BUG=1395 Review URL: https://webrtc-codereview.appspot.com/1098013 git-svn-id: http://webrtc.googlecode.com/svn/trunk@3541 4adac7df-926f-26a2-2b94-8c16560cd09d --- webrtc/test/testsupport/gtest_prod_util.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/webrtc/test/testsupport/gtest_prod_util.h b/webrtc/test/testsupport/gtest_prod_util.h index ec3cce6353..989d94d029 100644 --- a/webrtc/test/testsupport/gtest_prod_util.h +++ b/webrtc/test/testsupport/gtest_prod_util.h @@ -12,7 +12,10 @@ #define WEBRTC_TEST_TESTSUPPORT_GTEST_PROD_UTIL_H_ #pragma once -#include "testing/gtest/include/gtest/gtest_prod.h" +// Define our own version of FRIEND_TEST here rather than including +// gtest_prod.h to avoid depending on any part of GTest in production code. +#define FRIEND_TEST_WEBRTC(test_case_name, test_name)\ +friend class test_case_name##_##test_name##_Test // This file is a plain copy of Chromium's base/gtest_prod_util.h. // @@ -28,9 +31,9 @@ // FRIEND_TEST_ALL_PREFIXES(MyClassTest, MyMethod); // }; #define FRIEND_TEST_ALL_PREFIXES(test_case_name, test_name) \ - FRIEND_TEST(test_case_name, test_name); \ - FRIEND_TEST(test_case_name, DISABLED_##test_name); \ - FRIEND_TEST(test_case_name, FLAKY_##test_name); \ - FRIEND_TEST(test_case_name, FAILS_##test_name) + FRIEND_TEST_WEBRTC(test_case_name, test_name); \ + FRIEND_TEST_WEBRTC(test_case_name, DISABLED_##test_name); \ + FRIEND_TEST_WEBRTC(test_case_name, FLAKY_##test_name); \ + FRIEND_TEST_WEBRTC(test_case_name, FAILS_##test_name) #endif // WEBRTC_TEST_TESTSUPPORT_GTEST_PROD_UTIL_H_