зеркало из https://github.com/mozilla/gecko-dev.git
Bug 986160 - Add MozGtestFriend.h to deal with gtest in non test builds. r=glandium
This commit is contained in:
Родитель
7d7a2f9d30
Коммит
1591dfd8e6
|
@ -6352,6 +6352,7 @@ MOZ_ARG_DISABLE_BOOL(tests,
|
|||
|
||||
if test -n "$ENABLE_TESTS"; then
|
||||
GTEST_HAS_RTTI=0
|
||||
AC_DEFINE(ENABLE_TESTS)
|
||||
AC_DEFINE_UNQUOTED(GTEST_HAS_RTTI, 0)
|
||||
AC_SUBST(GTEST_HAS_RTTI)
|
||||
if test -n "$_WIN32_MSVC"; then
|
||||
|
|
|
@ -130,7 +130,6 @@ for var in ('MOZ_PERMISSIONS', 'MOZ_CHILD_PERMISSIONS'):
|
|||
DEFINES[var] = True
|
||||
|
||||
if CONFIG['ENABLE_TESTS']:
|
||||
DEFINES['ENABLE_TESTS'] = 1
|
||||
LOCAL_INCLUDES += [
|
||||
'ipc/glue',
|
||||
]
|
||||
|
|
|
@ -17,7 +17,7 @@ namespace mozilla { namespace dom {
|
|||
class TabChild;
|
||||
}}
|
||||
|
||||
#if defined(DEBUG) || defined(ENABLE_TESTS)
|
||||
#if defined(DEBUG)
|
||||
# define NECKO_ERRORS_ARE_FATAL_DEFAULT true
|
||||
#else
|
||||
# define NECKO_ERRORS_ARE_FATAL_DEFAULT false
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#ifndef GTEST_MOZGTESTFRIEND_H
|
||||
#define GTEST_MOZGTESTFRIEND_H
|
||||
|
||||
#ifdef ENABLE_TESTS
|
||||
#include "gtest_prod.h"
|
||||
#else
|
||||
#define FRIEND_TEST(a, b)
|
||||
#endif
|
||||
|
||||
#endif // GTEST_MOZGTESTFRIEND_H
|
|
@ -5,71 +5,76 @@
|
|||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
EXPORTS.gtest += [
|
||||
'gtest/include/gtest/gtest-death-test.h',
|
||||
'gtest/include/gtest/gtest-message.h',
|
||||
'gtest/include/gtest/gtest-param-test.h',
|
||||
'gtest/include/gtest/gtest-printers.h',
|
||||
'gtest/include/gtest/gtest-spi.h',
|
||||
'gtest/include/gtest/gtest-test-part.h',
|
||||
'gtest/include/gtest/gtest-typed-test.h',
|
||||
'gtest/include/gtest/gtest.h',
|
||||
'gtest/include/gtest/gtest_pred_impl.h',
|
||||
'gtest/include/gtest/gtest_prod.h',
|
||||
'MozGtestFriend.h',
|
||||
]
|
||||
|
||||
# GTest internal are exposed in gtest.h. See comment in gtest.h
|
||||
EXPORTS.gtest.internal += [
|
||||
'gtest/include/gtest/internal/gtest-death-test-internal.h',
|
||||
'gtest/include/gtest/internal/gtest-filepath.h',
|
||||
'gtest/include/gtest/internal/gtest-internal.h',
|
||||
'gtest/include/gtest/internal/gtest-linked_ptr.h',
|
||||
'gtest/include/gtest/internal/gtest-param-util-generated.h',
|
||||
'gtest/include/gtest/internal/gtest-param-util.h',
|
||||
'gtest/include/gtest/internal/gtest-port.h',
|
||||
'gtest/include/gtest/internal/gtest-string.h',
|
||||
'gtest/include/gtest/internal/gtest-tuple.h',
|
||||
'gtest/include/gtest/internal/gtest-type-util.h',
|
||||
]
|
||||
if CONFIG['ENABLE_TESTS']:
|
||||
EXPORTS.gtest += [
|
||||
'gtest/include/gtest/gtest-death-test.h',
|
||||
'gtest/include/gtest/gtest-message.h',
|
||||
'gtest/include/gtest/gtest-param-test.h',
|
||||
'gtest/include/gtest/gtest-printers.h',
|
||||
'gtest/include/gtest/gtest-spi.h',
|
||||
'gtest/include/gtest/gtest-test-part.h',
|
||||
'gtest/include/gtest/gtest-typed-test.h',
|
||||
'gtest/include/gtest/gtest.h',
|
||||
'gtest/include/gtest/gtest_pred_impl.h',
|
||||
'gtest/include/gtest/gtest_prod.h',
|
||||
]
|
||||
|
||||
EXPORTS.gmock += [
|
||||
'gmock/include/gmock/gmock-actions.h',
|
||||
'gmock/include/gmock/gmock-cardinalities.h',
|
||||
'gmock/include/gmock/gmock-generated-actions.h',
|
||||
'gmock/include/gmock/gmock-generated-function-mockers.h',
|
||||
'gmock/include/gmock/gmock-generated-matchers.h',
|
||||
'gmock/include/gmock/gmock-generated-nice-strict.h',
|
||||
'gmock/include/gmock/gmock-matchers.h',
|
||||
'gmock/include/gmock/gmock-more-actions.h',
|
||||
'gmock/include/gmock/gmock-spec-builders.h',
|
||||
'gmock/include/gmock/gmock.h',
|
||||
]
|
||||
# GTest internal are exposed in gtest.h. See comment in gtest.h
|
||||
EXPORTS.gtest.internal += [
|
||||
'gtest/include/gtest/internal/gtest-death-test-internal.h',
|
||||
'gtest/include/gtest/internal/gtest-filepath.h',
|
||||
'gtest/include/gtest/internal/gtest-internal.h',
|
||||
'gtest/include/gtest/internal/gtest-linked_ptr.h',
|
||||
'gtest/include/gtest/internal/gtest-param-util-generated.h',
|
||||
'gtest/include/gtest/internal/gtest-param-util.h',
|
||||
'gtest/include/gtest/internal/gtest-port.h',
|
||||
'gtest/include/gtest/internal/gtest-string.h',
|
||||
'gtest/include/gtest/internal/gtest-tuple.h',
|
||||
'gtest/include/gtest/internal/gtest-type-util.h',
|
||||
]
|
||||
|
||||
# gmock also includes internal interfaces in it's public header
|
||||
EXPORTS.gmock.internal += [
|
||||
'gmock/include/gmock/internal/gmock-generated-internal-utils.h',
|
||||
'gmock/include/gmock/internal/gmock-internal-utils.h',
|
||||
'gmock/include/gmock/internal/gmock-port.h',
|
||||
]
|
||||
EXPORTS.gmock += [
|
||||
'gmock/include/gmock/gmock-actions.h',
|
||||
'gmock/include/gmock/gmock-cardinalities.h',
|
||||
'gmock/include/gmock/gmock-generated-actions.h',
|
||||
'gmock/include/gmock/gmock-generated-function-mockers.h',
|
||||
'gmock/include/gmock/gmock-generated-matchers.h',
|
||||
'gmock/include/gmock/gmock-generated-nice-strict.h',
|
||||
'gmock/include/gmock/gmock-matchers.h',
|
||||
'gmock/include/gmock/gmock-more-actions.h',
|
||||
'gmock/include/gmock/gmock-spec-builders.h',
|
||||
'gmock/include/gmock/gmock.h',
|
||||
]
|
||||
|
||||
SOURCES += [
|
||||
'gmock/src/gmock-all.cc',
|
||||
'gtest/src/gtest-all.cc',
|
||||
'mozilla/GTestRunner.cpp',
|
||||
]
|
||||
# gmock also includes internal interfaces in it's public header
|
||||
EXPORTS.gmock.internal += [
|
||||
'gmock/include/gmock/internal/gmock-generated-internal-utils.h',
|
||||
'gmock/include/gmock/internal/gmock-internal-utils.h',
|
||||
'gmock/include/gmock/internal/gmock-port.h',
|
||||
]
|
||||
|
||||
LIBRARY_NAME = 'gtest'
|
||||
SOURCES += [
|
||||
'gmock/src/gmock-all.cc',
|
||||
'gtest/src/gtest-all.cc',
|
||||
'mozilla/GTestRunner.cpp',
|
||||
]
|
||||
|
||||
SOURCES += [
|
||||
'mozilla/SanityTest.cpp',
|
||||
]
|
||||
LIBRARY_NAME = 'gtest'
|
||||
|
||||
EXPORT_LIBRARY = True
|
||||
SOURCES += [
|
||||
'mozilla/SanityTest.cpp',
|
||||
]
|
||||
|
||||
LOCAL_INCLUDES += [
|
||||
'gmock',
|
||||
'gmock/include',
|
||||
'gtest',
|
||||
'gtest/include',
|
||||
]
|
||||
EXPORT_LIBRARY = True
|
||||
|
||||
FINAL_LIBRARY = 'xul-gtest'
|
||||
LOCAL_INCLUDES += [
|
||||
'gmock',
|
||||
'gmock/include',
|
||||
'gtest',
|
||||
'gtest/include',
|
||||
]
|
||||
|
||||
FINAL_LIBRARY = 'xul-gtest'
|
||||
|
|
|
@ -6,7 +6,4 @@
|
|||
|
||||
DIRS += ['components', 'atoms']
|
||||
|
||||
if CONFIG['ENABLE_TESTS']:
|
||||
DEFINES['ENABLE_TESTS'] = True
|
||||
|
||||
JAR_MANIFESTS += ['jar.mn']
|
||||
JAR_MANIFESTS += ['jar.mn']
|
||||
|
|
|
@ -90,8 +90,7 @@ if CONFIG['MOZ_OMX_PLUGIN']:
|
|||
if CONFIG['ENABLE_TESTS']:
|
||||
add_tier_dir('platform', 'testing/specialpowers')
|
||||
|
||||
if CONFIG['ENABLE_TESTS']:
|
||||
add_tier_dir('platform', 'testing/gtest')
|
||||
add_tier_dir('platform', 'testing/gtest')
|
||||
|
||||
add_tier_dir('platform', [
|
||||
'uriloader',
|
||||
|
|
Загрузка…
Ссылка в новой задаче