Back out 816311e43409 (bug 844288) on suspicion of causing dep OS X universal builds to fail in packaging

CLOSED TREE
This commit is contained in:
Phil Ringnalda 2013-05-29 23:42:20 -07:00
parent eebd326573
commit 68025a3c2f
18 changed files with 58 additions and 162 deletions

View File

@ -1329,8 +1329,8 @@ if test "$GNU_CC"; then
CFLAGS="$CFLAGS -std=gnu99 -fgnu89-inline"
# FIXME: Let us build with strict aliasing. bug 414641.
CFLAGS="$CFLAGS -fno-strict-aliasing"
MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$(notdir $@) -o $@'
MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$(notdir $@) -o $@'
MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
DSO_LDOPTS='-shared'
if test "$GCC_USE_GNU_LD"; then
# Some tools like ASan use a runtime library that is only
@ -1440,8 +1440,8 @@ elif test "$SOLARIS_SUNPRO_CC"; then
fi
_DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
else
MKSHLIB='$(LD) $(DSO_LDOPTS) -h $(notdir $@) -o $@'
MKCSHLIB='$(LD) $(DSO_LDOPTS) -h $(notdir $@) -o $@'
MKSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
MKCSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
DSO_LDOPTS='-shared'
if test "$GNU_LD"; then
@ -2299,8 +2299,8 @@ ia64*-hpux*)
if test "$LIBRUNPATH"; then
DSO_LDOPTS="-Wl,-R$LIBRUNPATH $DSO_LDOPTS"
fi
MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,$(notdir $@) -o $@'
MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,$(notdir $@)) -o $@'
MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,lib$(LIBRARY_NAME)$(DLL_SUFFIX) -o $@'
MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,lib$(LIBRARY_NAME)$(DLL_SUFFIX) -o $@'
;;
*-openbsd*)
@ -2406,8 +2406,8 @@ ia64*-hpux*)
[LDFLAGS=$_SAVE_LDFLAGS])
fi
MOZ_OPTIMIZE_FLAGS="-xO4"
MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_FLAGS) $(DSO_LDOPTS) -h $(notdir $@) -o $@'
MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_FLAGS) $(DSO_LDOPTS) -h $(notdir $@) -o $@'
MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_FLAGS) $(DSO_LDOPTS) -h $@ -o $@'
MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_FLAGS) $(DSO_LDOPTS) -h $@ -o $@'
MKSHLIB_FORCE_ALL='-z allextract'
MKSHLIB_UNFORCE_ALL='-z defaultextract'
DSO_LDOPTS='-G'
@ -6386,7 +6386,16 @@ MOZ_ARG_DISABLE_BOOL(tests,
ENABLE_TESTS=,
ENABLE_TESTS=1 )
if test -n "$ENABLE_TESTS"; then
# Currently GTest is linked into libxul. This means it must be off by default.
# Follow up will be to generate libxul.so and libxul-test.so to let GTest
# be compiled along with ENABLE_TESTS
MOZ_ARG_ENABLE_BOOL(gtest,
[ --enable-gtest
Enable GTest libxul unit test.],
MOZ_ENABLE_GTEST=1,
MOZ_ENABLE_GTEST= )
if test -n "$MOZ_ENABLE_GTEST"; then
if test "${OS_TARGET}" = "WINNT" -o "${OS_TARGET}" = "Darwin" -o "${OS_TARGET}" = "Linux" -o "${OS_TARGET}" = "Android"; then
MOZ_ENABLE_GTEST=1
GTEST_HAS_RTTI=0
@ -6394,6 +6403,8 @@ if test -n "$ENABLE_TESTS"; then
AC_DEFINE_UNQUOTED(GTEST_HAS_RTTI, 0)
AC_SUBST(MOZ_ENABLE_GTEST)
AC_SUBST(GTEST_HAS_RTTI)
else
AC_MSG_ERROR([Cannot build with --enable-gtest on this platform.])
fi
if test "${OS_TARGET}" = "Android"; then
AC_DEFINE(GTEST_OS_LINUX_ANDROID)

View File

@ -15,6 +15,14 @@ MSVC_ENABLE_PGO := 1
LIBXUL_LIBRARY = 1
EXPORT_LIBRARY = 1
GTEST_CPPSRCS = \
GTestMain.cpp \
TestBase.cpp \
TestPoint.cpp \
TestScaling.cpp \
TestCairo.cpp \
$(NULL)
ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
CMMSRCS = \
QuartzSupport.mm \

View File

@ -30,6 +30,10 @@ ifdef MOZ_DEBUG
DEFINES += -DD3D_DEBUG_INFO
endif
GTEST_CPPSRCS = \
TestTiledLayerBuffer.cpp \
$(NULL)
ifdef MOZ_ENABLE_D3D10_LAYER
DEFINES += -DMOZ_ENABLE_D3D10_LAYER
endif

View File

@ -25,9 +25,6 @@ DIRS += [
if CONFIG['MOZ_ENABLE_SKIA']:
DIRS += ['skia']
if CONFIG['ENABLE_TESTS']:
DIRS += ['tests/gtest']
TEST_TOOL_DIRS += ['tests']
MODULE = 'gfx'

View File

@ -1,43 +0,0 @@
#
# 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/.
DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@ $(srcdir)/$(DEPTH)/gfx/2d/unittest
relativesrcdir = @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
# Create a GTest library
MODULE_NAME = gfxtest
LIBRARY_NAME = gfxtest
LIBXUL_LIBRARY = 1
IS_COMPONENT = 1
EXPORT_LIBRARY = 1
LOCAL_INCLUDES = \
-I$(topsrcdir)/gfx/layers \
-I$(topsrcdir)/gfx/2d \
-I$(topsrcdir)/gfx/2d/unittest \
$(NULL)
GTEST_CPPSRCS = \
TestTiledLayerBuffer.cpp \
$(NULL)
# Because of gkmedia on windows we wont find these
# symbols in xul.dll.
ifneq ($(MOZ_WIDGET_TOOLKIT),windows)
GTEST_CPPSRCS += \
TestMoz2D.cpp \
TestBase.cpp \
TestPoint.cpp \
TestScaling.cpp \
$(NULL)
endif
include $(topsrcdir)/config/rules.mk

View File

@ -1,8 +0,0 @@
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# 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/.
MODULE = 'gfxtest'

View File

@ -1151,8 +1151,8 @@ if test "$GNU_CC"; then
# Per bug 719659 comment 2, some of the headers on ancient build machines
# may require gnu89 inline semantics. But otherwise, we use C99.
CFLAGS="$CFLAGS -std=gnu99 -fgnu89-inline"
MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$(notdir $@) -o $@'
MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$(notdir $@) -o $@'
MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
DSO_LDOPTS='-shared'
if test "$GCC_USE_GNU_LD"; then
# Some tools like ASan use a runtime library that is only
@ -1225,8 +1225,8 @@ elif test "$SOLARIS_SUNPRO_CC"; then
fi
_DEFINES_CFLAGS='$(ACDEFINES) -D_JS_CONFDEFS_H_ -DMOZILLA_CLIENT'
else
MKSHLIB='$(LD) $(DSO_LDOPTS) -h $(notdir $@) -o $@'
MKCSHLIB='$(LD) $(DSO_LDOPTS) -h $(notdir $@) -o $@'
MKSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
MKCSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
DSO_LDOPTS='-shared'
if test "$GNU_LD"; then
@ -1845,8 +1845,8 @@ ia64*-hpux*)
if test "$LIBRUNPATH"; then
DSO_LDOPTS="-Wl,-R$LIBRUNPATH $DSO_LDOPTS"
fi
MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,$(notdir $@) -o $@'
MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,$(notdir $@) -o $@'
MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,lib$(LIBRARY_NAME)$(DLL_SUFFIX) -o $@'
MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,lib$(LIBRARY_NAME)$(DLL_SUFFIX) -o $@'
;;
*-openbsd*)
@ -1949,8 +1949,8 @@ ia64*-hpux*)
[LDFLAGS=$_SAVE_LDFLAGS])
fi
MOZ_OPTIMIZE_FLAGS="-xO4"
MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_FLAGS) $(DSO_LDOPTS) -h $(notdir $@) -o $@'
MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_FLAGS) $(DSO_LDOPTS) -h $(notdir $@) -o $@'
MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_FLAGS) $(DSO_LDOPTS) -h $@ -o $@'
MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_FLAGS) $(DSO_LDOPTS) -h $@ -o $@'
MKSHLIB_FORCE_ALL='-z allextract'
MKSHLIB_UNFORCE_ALL='-z defaultextract'
DSO_LDOPTS='-G'

View File

@ -464,10 +464,6 @@ class GTestCommands(MachCommandBase):
@CommandArgument('--shuffle', '-s', action='store_true',
help='Randomize the execution order of tests.')
def gtest(self, shuffle, jobs, gtest_filter, tbpl_parser):
# We lazy build gtest because it's slow to link
self._run_make(directory="testing/gtest", target='gtest', ensure_exit_code=True)
app_path = self.get_binary_path('app')
# Use GTest environment variable to control test execution
@ -475,8 +471,6 @@ class GTestCommands(MachCommandBase):
# https://code.google.com/p/googletest/wiki/AdvancedGuide#Running_Test_Programs:_Advanced_Options
gtest_env = {b'GTEST_FILTER': gtest_filter}
gtest_env[b"MOZ_RUN_GTEST"] = b"True"
if shuffle:
gtest_env[b"GTEST_SHUFFLE"] = b"True"

View File

@ -36,15 +36,3 @@ LOCAL_INCLUDES += \
include $(topsrcdir)/config/rules.mk
ifeq (browser,$(MOZ_BUILD_APP))
# Disable because of metro linking error:
# LNK1181: cannot open input file 'runtimeobject.lib'
ifndef MOZ_METRO
check gtest::
$(MAKE) -C $(DEPTH)/toolkit/library gtestxul
ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
$(MAKE) -C $(DEPTH)/browser/app repackage
endif
endif
endif

View File

@ -3,11 +3,9 @@
* * 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/. */
#include "GTestRunner.h"
#include "gtest/gtest.h"
#include "mozilla/Attributes.h"
#include "mozilla/NullPtr.h"
#include "prenv.h"
using ::testing::EmptyTestEventListener;
using ::testing::InitGoogleTest;
@ -67,7 +65,7 @@ static void ReplaceGTestLogger()
listeners.Append(new MozillaPrinter);
}
int RunGTestFunc()
int RunGTest()
{
int c = 0;
InitGoogleTest(&c, static_cast<char**>(nullptr));
@ -76,20 +74,9 @@ int RunGTestFunc()
ReplaceGTestLogger();
}
PR_SetEnv("XPCOM_DEBUG_BREAK=stack-and-abort");
setenv("XPCOM_DEBUG_BREAK", "stack-and-abort", false);
return RUN_ALL_TESTS();
}
// We use a static var 'RunGTest' defined in nsAppRunner.cpp.
// RunGTest is initialized to NULL but if GTest (this file)
// is linked in then RunGTest will be set here indicating
// GTest is supported.
class _InitRunGTest {
public:
_InitRunGTest() {
RunGTest = RunGTestFunc;
}
} InitRunGTest;
}

View File

@ -5,6 +5,6 @@
namespace mozilla {
extern int (*RunGTest)();
int RunGTest();
}

View File

@ -296,6 +296,10 @@ endif
STATIC_LIBS += thebes gl ycbcr
ifdef MOZ_ENABLE_GTEST
COMPONENT_LIBS += gtest xpcom_glue_gtest
endif
ifdef MOZ_ENABLE_PROFILER_SPS
COMPONENT_LIBS += profiler
endif
@ -678,39 +682,7 @@ ifeq (WINNT_1,$(OS_TARGET)_$(MOZ_PROFILE_USE))
LD := $(PYTHON) $(topsrcdir)/build/link.py $(CURDIR)/linker-vsize $(LD)
endif
ifndef LINK_GTEST
libs:: $(FINAL_TARGET)/dependentlibs.list
else
libs::
endif
ifdef MAKE_FRAMEWORK
EFFECTIVE_LIB_PREFIX=
else
EFFECTIVE_LIB_PREFIX=$(LIB_PREFIX)
endif
$(FINAL_TARGET)/dependentlibs.list.gtest: $(FINAL_TARGET)/dependentlibs.list
sed -e "s|$(SHARED_LIBRARY)|gtest/$(SHARED_LIBRARY)|" $< > $@
.PHONY: gtestxul
gtestxul: $(EFFECTIVE_LIB_PREFIX)gtest/$(EFFECTIVE_LIB_PREFIX)$(LIBRARY_NAME)
# Remove this target when actually linking gtest to prevent redefining
# the implicit rules.mk target
ifndef LINK_GTEST
$(EFFECTIVE_LIB_PREFIX)gtest/$(EFFECTIVE_LIB_PREFIX)$(LIBRARY_NAME): $(FINAL_TARGET)/dependentlibs.list.gtest
$(MKDIR) -p $(EFFECTIVE_LIB_PREFIX)gtest
$(MAKE) libs SHARED_LIBRARY_NAME=gtest/$(EFFECTIVE_LIB_PREFIX)$(LIBRARY_NAME) FINAL_TARGET=$(FINAL_TARGET)/gtest SDK_LIBRARY= IMPORT_LIB_DEST=$(IMPORT_LIB_DEST)/gtest LINK_GTEST=true
endif
ifdef LINK_GTEST
COMPONENT_LIBS += \
gtest \
gfxtest \
$(NULL)
endif
$(FINAL_TARGET)/dependentlibs.list: dependentlibs.py $(SHARED_LIBRARY) $(wildcard $(if $(wildcard $(FINAL_TARGET)/dependentlibs.list),$(addprefix $(FINAL_TARGET)/,$(shell cat $(FINAL_TARGET)/dependentlibs.list))))
$(PYTHON) $< $(SHARED_LIBRARY) -L $(FINAL_TARGET) $(if $(TOOLCHAIN_PREFIX),$(addprefix -p ,$(TOOLCHAIN_PREFIX))) > $@

View File

@ -7,17 +7,11 @@ topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
# When we're linking GTest we recurse into this directory but don't need
# to generate this library
ifndef LINK_GTEST
LIBRARY_NAME = dummyvccorlib
include $(DEPTH)/config/autoconf.mk
FORCE_SHARED_LIB=1
endif
include $(topsrcdir)/config/rules.mk

View File

@ -128,8 +128,9 @@ add_tier_dir('platform', 'media/kiss_fft')
if CONFIG['ENABLE_TESTS']:
add_tier_dir('platform', 'testing/specialpowers')
if CONFIG['ENABLE_TESTS']:
if CONFIG['MOZ_ENABLE_GTEST']:
add_tier_dir('platform', 'testing/gtest')
add_tier_dir('platform', 'xpcom/glue/tests/gtest')
add_tier_dir('platform', [
'uriloader',

View File

@ -196,7 +196,7 @@ using mozilla::scache::StartupCache;
#endif
#include "base/command_line.h"
#ifdef MOZ_ENABLE_TESTS
#ifdef MOZ_ENABLE_GTEST
#include "GTestRunner.h"
#endif
@ -242,10 +242,6 @@ static char **gQtOnlyArgv;
#endif
#include "BinaryPath.h"
namespace mozilla {
int (*RunGTest)() = 0;
}
using mozilla::dom::ContentParent;
using mozilla::dom::ContentChild;
@ -3202,15 +3198,14 @@ XREMain::XRE_mainInit(bool* aExitFlag)
return 0;
}
if (PR_GetEnv("MOZ_RUN_GTEST")) {
int result;
// RunGTest will only be set if we're in xul-unit
if (mozilla::RunGTest) {
result = mozilla::RunGTest();
} else {
result = 1;
printf("TEST-UNEXPECTED-FAIL | gtest | Not compiled with enable-tests\n");
}
ar = CheckArg("unittest", true);
if (ar == ARG_FOUND) {
#if MOZ_ENABLE_GTEST
int result = mozilla::RunGTest();
#else
int result = 1;
printf("TEST-UNEXPECTED-FAIL | Not compiled with GTest enabled\n");
#endif
*aExitFlag = true;
return result;
}

View File

@ -416,10 +416,6 @@ XPCOMGlueLoad(const char *xpcomFile)
cursor = xpcomDir;
}
if (getenv("MOZ_RUN_GTEST")) {
strcat(xpcomDir, ".gtest");
}
ScopedCloseFile flist;
flist = TS_tfopen(xpcomDir, READ_TEXTMODE);
if (!flist) {