Revert "Make GYP build usable for day-to-day work"

This reverts r8674 due to failures on the buildbots.

Review URL: http://codereview.chromium.org/7396022

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8677 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
jkummerow@chromium.org 2011-07-18 16:39:41 +00:00
parent a58580011e
commit 7ac9dfcc81
15 changed files with 88 additions and 555 deletions

1
.gitignore vendored
View File

@ -31,4 +31,5 @@ shell_g
/tools/visual_studio/Release
/xcodebuild/
TAGS
Makefile
*.Makefile

110
Makefile
View File

@ -1,110 +0,0 @@
# Copyright 2011 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Variable default definitions. Override them by exporting them in your shell.
CXX ?= "g++" # For distcc: export CXX="distcc g++"
LINK ?= "g++"
OUTDIR ?= out
TESTJOBS ?= -j16
GYPFLAGS ?= -Dv8_can_use_vfp_instructions=true
# Architectures and modes to be compiled.
ARCHES = ia32 x64 arm
MODES = release debug
# List of files that trigger Makefile regeneration:
GYPFILES = build/all.gyp build/common.gypi build/v8-features.gypi \
preparser/preparser.gyp samples/samples.gyp src/d8.gyp \
test/cctest/cctest.gyp tools/gyp/v8.gyp
# Generates all combinations of ARCHES and MODES, e.g. "ia32.release".
BUILDS = $(foreach mode,$(MODES),$(addsuffix .$(mode),$(ARCHES)))
CHECKS = $(addsuffix .check,$(BUILDS))
# Generates corresponding test targets, e.g. "ia32.release.check".
.PHONY: all release debug ia32 x64 arm $(BUILDS)
# Target definitions. "all" is the default, you can specify any others on the
# command line, e.g. "make ia32". Targets defined in $(BUILDS), e.g.
# "ia32.debug", can also be specified.
all: release debug
release: $(addsuffix .release,$(ARCHES))
debug: $(addsuffix .debug,$(ARCHES))
ia32: $(addprefix ia32.,$(MODES))
x64: $(addprefix x64.,$(MODES))
arm: $(addprefix arm.,$(MODES))
.SECONDEXPANSION:
$(BUILDS): $(OUTDIR)/Makefile-$$(basename $$@)
@$(MAKE) -C "$(OUTDIR)" -f Makefile-$(basename $@) \
CXX="$(CXX)" LINK="$(LINK)" \
BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \
python -c "print raw_input().capitalize()") \
builddir="$(shell pwd)/$(OUTDIR)/$@"
# Test targets.
check: all
@tools/test-wrapper-gypbuild.py $(TESTJOBS)
debug.check: debug
@tools/test-wrapper-gypbuild.py $(TESTJOBS) --mode=debug
release.check: release
@tools/test-wrapper-gypbuild.py $(TESTJOBS) --mode=release
$(CHECKS): $$(basename $$@)
@tools/test-wrapper-gypbuild.py $(TESTJOBS) --arch-and-mode=$(basename $@)
# Clean targets. You can clean each architecture individually, or everything.
$(addsuffix .clean,$(ARCHES)):
rm -f $(OUTDIR)/Makefile-$(basename $@)
rm -rf $(OUTDIR)/$(basename $@).release
rm -rf $(OUTDIR)/$(basename $@).debug
clean: $(addsuffix .clean,$(ARCHES))
# GYP file generation targets.
$(OUTDIR)/Makefile-ia32: $(GYPFILES)
build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \
-Ibuild/common.gypi --depth=. -Dtarget_arch=ia32 -S-ia32 \
$(GYPFLAGS)
$(OUTDIR)/Makefile-x64: $(GYPFILES)
build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \
-Ibuild/common.gypi --depth=. -Dtarget_arch=x64 -S-x64 \
$(GYPFLAGS)
$(OUTDIR)/Makefile-arm: $(GYPFILES) build/armu.gypi
build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \
-Ibuild/common.gypi --depth=. -Ibuild/armu.gypi -S-arm \
$(GYPFLAGS)

View File

@ -1,4 +1,4 @@
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Copyright (c) 2010 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
@ -8,7 +8,6 @@
'target_name': 'All',
'type': 'none',
'dependencies': [
'../preparser/preparser.gyp:*',
'../samples/samples.gyp:*',
'../src/d8.gyp:d8',
],

View File

@ -32,5 +32,5 @@
'armv7': 1,
'arm_neon': 0,
'arm_fpu': 'vfpv3',
},
}
}

View File

@ -1,4 +1,4 @@
# Copyright 2011 the V8 project authors. All rights reserved.
# Copyright 2010 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
@ -46,37 +46,23 @@
'host_arch%': '<(host_arch)',
'target_arch%': '<(host_arch)',
'v8_target_arch%': '<(target_arch)',
'conditions': [
['(target_arch=="arm" and host_arch!="arm") or \
(target_arch=="x64" and host_arch!="x64")', {
'want_separate_host_toolset': 1,
}, {
'want_separate_host_toolset': 0,
}],
],
},
'target_defaults': {
'default_configuration': 'Debug',
'defines': [
'ENABLE_DEBUGGER_SUPPORT',
],
'configurations': {
'Debug': {
'cflags': [ '-g', '-O0' ],
'defines': [ 'ENABLE_DISASSEMBLER', 'DEBUG', 'V8_ENABLE_CHECKS',
'OBJECT_PRINT' ],
'defines': [ 'ENABLE_DISASSEMBLER', 'DEBUG' ],
},
'Release': {
'cflags': [ '-O3', '-fomit-frame-pointer', '-fdata-sections',
'-ffunction-sections' ],
'cflags': [ '-O3', '-fomit-frame-pointer', '-fdata-sections', '-ffunction-sections' ],
},
},
},
'conditions': [
[ 'OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', {
'target_defaults': {
'cflags': [ '-Wall', '-pthread', '-fno-rtti', '-fno-exceptions',
'-pedantic' ],
'cflags': [ '-Wall', '-pthread', '-fno-rtti', '-fno-exceptions' ],
'ldflags': [ '-pthread', ],
'conditions': [
[ 'target_arch=="ia32"', {

View File

@ -89,19 +89,6 @@
'USE_EABI_HARDFLOAT=1',
'CAN_USE_VFP_INSTRUCTIONS',
],
'cflags': [
'-mfloat-abi=hard',
],
}, {
'defines': [
'USE_EABI_HARDFLOAT=0',
],
}],
# The ARM assembler assumes the host is 32 bits,
# so force building 32-bit host tools.
[ 'host_arch=="x64"', {
'cflags': ['-m32'],
'ldflags': ['-m32'],
}],
],
}],

View File

@ -1,41 +0,0 @@
# Copyright 2011 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
{
'targets': [
{
'target_name': 'preparser',
'type': 'executable',
'dependencies': [
'../tools/gyp/v8.gyp:preparser_lib',
],
'sources': [
'preparser-process.cc',
],
},
],
}

View File

@ -1,4 +1,4 @@
# Copyright 2011 the V8 project authors. All rights reserved.
# Copyright 2010 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
@ -26,24 +26,23 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
{
'target_defaults': {
'type': 'executable',
'dependencies': [
'../tools/gyp/v8.gyp:v8',
],
'include_dirs': [
'../include',
],
},
'targets': [
{
'target_name': 'shell',
'type': 'executable',
'dependencies': [
'../tools/gyp/v8.gyp:v8',
],
'sources': [
'shell.cc',
],
},
{
'target_name': 'process',
'type': 'executable',
'dependencies': [
'../tools/gyp/v8.gyp:v8',
],
'sources': [
'process.cc',
],

View File

@ -47,17 +47,9 @@
],
'conditions': [
[ 'component!="shared_library"', {
'dependencies': [ 'd8_js2c#host', ],
'sources': [ 'd8-debug.cc', '<(SHARED_INTERMEDIATE_DIR)/d8-js.cc', ],
'conditions': [
[ 'want_separate_host_toolset==1', {
'dependencies': [
'd8_js2c#host',
],
}, {
'dependencies': [
'd8_js2c',
],
}],
[ 'console=="readline"', {
'libraries': [ '-lreadline', ],
'sources': [ 'd8-readline.cc' ],
@ -76,19 +68,13 @@
{
'target_name': 'd8_js2c',
'type': 'none',
'toolsets': ['host'],
'variables': {
'js_files': [
'd8.js',
'macros.py',
],
},
'conditions': [
[ 'want_separate_host_toolset==1', {
'toolsets': ['host'],
}, {
'toolsets': ['target'],
}]
],
'actions': [
{
'action_name': 'd8_js2c',
@ -104,7 +90,6 @@
'../tools/js2c.py',
'<@(_outputs)',
'D8',
'off', # compress startup data
'<@(js_files)'
],
},

View File

@ -78,7 +78,6 @@
'test-log.cc',
'test-mark-compact.cc',
'test-parsing.cc',
'test-platform-tls.cc',
'test-profile-generator.cc',
'test-regexp.cc',
'test-reloc-info.cc',

View File

@ -48,11 +48,7 @@ class CcTestCase(test.TestCase):
return self.path[-1]
def BuildCommand(self, name):
serialization_file = ''
if exists(join(self.context.buildspace, 'obj', 'test', self.mode)):
serialization_file = join('obj', 'test', self.mode, 'serdes')
else:
serialization_file = join('obj', 'serdes')
serialization_file = join('obj', 'test', self.mode, 'serdes')
serialization_file += '_' + self.GetName()
serialization_file = join(self.context.buildspace, serialization_file)
serialization_file += ''.join(self.variant_flags).replace('-', '_')
@ -82,15 +78,10 @@ class CcTestConfiguration(test.TestConfiguration):
return ['cctests']
def ListTests(self, current_path, path, mode, variant_flags):
executable = 'cctest'
executable = join('obj', 'test', mode, 'cctest')
if utils.IsWindows():
executable += '.exe'
executable = join(self.context.buildspace, executable)
if not exists(executable):
executable = join('obj', 'test', mode, 'cctest')
if utils.IsWindows():
executable += '.exe'
executable = join(self.context.buildspace, executable)
output = test.Execute([executable, '--list'], self.context)
if output.exit_code != 0:
print output.stdout

View File

@ -122,15 +122,10 @@ class PreparserTestConfiguration(test.TestConfiguration):
{"Test": Test, "Template": Template}, {})
def ListTests(self, current_path, path, mode, variant_flags):
executable = 'preparser'
executable = join('obj', 'preparser', mode, 'preparser')
if utils.IsWindows():
executable += '.exe'
executable = join(self.context.buildspace, executable)
if not exists(executable):
executable = join('obj', 'preparser', mode, 'preparser')
if utils.IsWindows():
executable += '.exe'
executable = join(self.context.buildspace, executable)
expectations = self.GetExpectations()
result = []
# Find all .js files in tests/preparser directory.

View File

@ -61,6 +61,9 @@
'conditions': [
['use_system_v8==0', {
'target_defaults': {
'defines': [
'ENABLE_DEBUGGER_SUPPORT',
],
'conditions': [
['OS!="mac"', {
# TODO(mark): The OS!="mac" conditional is temporary. It can be
@ -94,19 +97,6 @@
'USE_EABI_HARDFLOAT=1',
'CAN_USE_VFP_INSTRUCTIONS',
],
'cflags': [
'-mfloat-abi=hard',
],
}, {
'defines': [
'USE_EABI_HARDFLOAT=0',
],
}],
# The ARM assembler assumes the host is 32 bits,
# so force building 32-bit host tools.
[ 'host_arch=="x64"', {
'cflags': ['-m32'],
'ldflags': ['-m32'],
}],
],
}],
@ -165,10 +155,6 @@
['OS=="freebsd" or OS=="openbsd"', {
'cflags': [ '-I/usr/local/include' ],
}],
['OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
'cflags': [ '-Wall', '-Werror', '-W', '-Wno-unused-parameter',
'-Wnon-virtual-dtor' ],
}],
],
},
'Release': {
@ -178,6 +164,10 @@
'-O2',
'-Os',
],
'cflags': [
'-fomit-frame-pointer',
'-O3',
],
'conditions': [
[ 'gcc_version==44', {
'cflags': [
@ -239,12 +229,8 @@
'targets': [
{
'target_name': 'v8',
'toolsets': ['host', 'target'],
'conditions': [
['want_separate_host_toolset==1', {
'toolsets': ['host', 'target'],
}, {
'toolsets': ['target'],
}],
['v8_use_snapshot=="true"', {
'dependencies': ['v8_snapshot'],
},
@ -284,20 +270,25 @@
'type': 'none',
}],
],
'direct_dependent_settings': {
'include_dirs': [
'../../include',
],
},
},
{
'target_name': 'v8_snapshot',
'type': '<(library)',
'toolsets': ['host', 'target'],
'conditions': [
['want_separate_host_toolset==1', {
'toolsets': ['host', 'target'],
'dependencies': ['mksnapshot#host', 'js2c#host'],
}, {
'toolsets': ['target'],
'dependencies': ['mksnapshot', 'js2c'],
}],
['component=="shared_library"', {
'conditions': [
# The ARM assembler assumes the host is 32 bits, so force building
# 32-bit host tools.
['v8_target_arch=="arm" and host_arch=="x64" and _toolset=="host"', {
'cflags': ['-m32'],
'ldflags': ['-m32'],
}],
['OS=="win"', {
'defines': [
'BUILDING_V8_SHARED',
@ -321,6 +312,8 @@
}],
],
'dependencies': [
'mksnapshot#host',
'js2c#host',
'v8_base',
],
'include_dirs+': [
@ -387,7 +380,9 @@
{
'target_name': 'v8_nosnapshot',
'type': '<(library)',
'toolsets': ['host', 'target'],
'dependencies': [
'js2c#host',
'v8_base',
],
'include_dirs+': [
@ -399,12 +394,11 @@
'../../src/snapshot-empty.cc',
],
'conditions': [
['want_separate_host_toolset==1', {
'toolsets': ['host', 'target'],
'dependencies': ['js2c#host'],
}, {
'toolsets': ['target'],
'dependencies': ['js2c'],
# The ARM assembler assumes the host is 32 bits, so force building
# 32-bit host tools.
['v8_target_arch=="arm" and host_arch=="x64" and _toolset=="host"', {
'cflags': ['-m32'],
'ldflags': ['-m32'],
}],
['component=="shared_library"', {
'defines': [
@ -417,6 +411,7 @@
{
'target_name': 'v8_base',
'type': '<(library)',
'toolsets': ['host', 'target'],
'include_dirs+': [
'../../src',
],
@ -671,12 +666,10 @@
'../../src/extensions/gc-extension.h',
],
'conditions': [
['want_separate_host_toolset==1', {
'toolsets': ['host', 'target'],
}, {
'toolsets': ['target'],
}],
['v8_target_arch=="arm"', {
'include_dirs+': [
'../../src/arm',
],
'sources': [
'../../src/arm/assembler-arm-inl.h',
'../../src/arm/assembler-arm.cc',
@ -709,8 +702,19 @@
'../../src/arm/simulator-arm.cc',
'../../src/arm/stub-cache-arm.cc',
],
'conditions': [
# The ARM assembler assumes the host is 32 bits,
# so force building 32-bit host tools.
['host_arch=="x64" and _toolset=="host"', {
'cflags': ['-m32'],
'ldflags': ['-m32'],
}]
]
}],
['v8_target_arch=="ia32" or v8_target_arch=="mac" or OS=="mac"', {
'include_dirs+': [
'../../src/ia32',
],
'sources': [
'../../src/ia32/assembler-ia32-inl.h',
'../../src/ia32/assembler-ia32.cc',
@ -742,6 +746,9 @@
],
}],
['v8_target_arch=="x64" or v8_target_arch=="mac" or OS=="mac"', {
'include_dirs+': [
'../../src/x64',
],
'sources': [
'../../src/x64/assembler-x64-inl.h',
'../../src/x64/assembler-x64.cc',
@ -774,6 +781,10 @@
}],
['OS=="linux"', {
'link_settings': {
'libraries': [
# Needed for clock_gettime() used by src/platform-linux.cc.
'-lrt',
],
'conditions': [
['v8_compress_startup_data=="bz2"', {
'libraries': [
@ -859,13 +870,7 @@
{
'target_name': 'js2c',
'type': 'none',
'conditions': [
['want_separate_host_toolset==1', {
'toolsets': ['host'],
}, {
'toolsets': ['target'],
}],
],
'toolsets': ['host'],
'variables': {
'library_files': [
'../../src/runtime.js',
@ -931,6 +936,7 @@
{
'target_name': 'mksnapshot',
'type': 'executable',
'toolsets': ['host'],
'dependencies': [
'v8_nosnapshot',
],
@ -941,10 +947,11 @@
'../../src/mksnapshot.cc',
],
'conditions': [
['want_separate_host_toolset==1', {
'toolsets': ['host'],
}, {
'toolsets': ['target'],
# The ARM assembler assumes the host is 32 bits, so force building
# 32-bit host tools.
['v8_target_arch=="arm" and host_arch=="x64" and _toolset=="host"', {
'cflags': ['-m32'],
'ldflags': ['-m32'],
}],
['v8_compress_startup_data=="bz2"', {
'libraries': [
@ -955,6 +962,7 @@
{
'target_name': 'v8_shell',
'type': 'executable',
'toolsets': ['host'],
'dependencies': [
'v8'
],
@ -962,57 +970,29 @@
'../../samples/shell.cc',
],
'conditions': [
['want_separate_host_toolset==1', {
'toolsets': ['host'],
}, {
'toolsets': ['target'],
}],
['OS=="win"', {
# This could be gotten by not setting chromium_code, if that's OK.
'defines': ['_CRT_SECURE_NO_WARNINGS'],
}],
# The ARM assembler assumes the host is 32 bits, so force building
# 32-bit host tools.
['v8_target_arch=="arm" and host_arch=="x64" and _toolset=="host"', {
'cflags': ['-m32'],
'ldflags': ['-m32'],
}],
['v8_compress_startup_data=="bz2"', {
'libraries': [
'-lbz2',
]}],
],
},
{
'target_name': 'preparser_lib',
'type': '<(library)',
'include_dirs+': [
'../../src',
],
'sources': [
'../../src/allocation.cc',
'../../src/bignum.cc',
'../../src/cached-powers.cc',
'../../src/conversions.cc',
'../../src/hashmap.cc',
'../../src/preparse-data.cc',
'../../src/preparser.cc',
'../../src/preparser-api.cc',
'../../src/scanner-base.cc',
'../../src/strtod.cc',
'../../src/token.cc',
'../../src/unicode.cc',
'../../src/utils.cc',
],
},
],
}, { # use_system_v8 != 0
'targets': [
{
'target_name': 'v8',
'type': 'settings',
'conditions': [
['want_separate_host_toolset==1', {
'toolsets': ['host', 'target'],
}, {
'toolsets': ['target'],
}],
],
'toolsets': ['host', 'target'],
'link_settings': {
'libraries': [
'-lv8',
@ -1022,13 +1002,7 @@
{
'target_name': 'v8_shell',
'type': 'none',
'conditions': [
['want_separate_host_toolset==1', {
'toolsets': ['host'],
}, {
'toolsets': ['target'],
}],
],
'toolsets': ['host'],
'dependencies': [
'v8'
],

View File

@ -1,223 +0,0 @@
#!/usr/bin/env python
#
# Copyright 2011 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# This is a convenience script to run the existing tools/test.py script
# when using the gyp/make based build.
# It is intended as a stop-gap rather than a long-term solution.
import optparse
import os
from os.path import join, dirname, abspath
import subprocess
import sys
PROGRESS_INDICATORS = ['verbose', 'dots', 'color', 'mono']
def BuildOptions():
result = optparse.OptionParser()
# Flags specific to this wrapper script:
result.add_option("--arch-and-mode",
help='Architecture and mode in the format "arch.mode"',
default=None)
# Flags this wrapper script handles itself:
result.add_option("-m", "--mode",
help="The test modes in which to run (comma-separated)",
default='release,debug')
result.add_option("--arch",
help='The architectures to run tests for (comma-separated)',
default='ia32,x64,arm')
# Flags that are passed on to the wrapped test.py script:
result.add_option("-v", "--verbose", help="Verbose output",
default=False, action="store_true")
result.add_option("-p", "--progress",
help="The style of progress indicator (verbose, dots, color, mono)",
choices=PROGRESS_INDICATORS, default="mono")
result.add_option("--report", help="Print a summary of the tests to be run",
default=False, action="store_true")
result.add_option("-s", "--suite", help="A test suite",
default=[], action="append")
result.add_option("-t", "--timeout", help="Timeout in seconds",
default=60, type="int")
result.add_option("--snapshot", help="Run the tests with snapshot turned on",
default=False, action="store_true")
result.add_option("--special-command", default=None)
result.add_option("--valgrind", help="Run tests through valgrind",
default=False, action="store_true")
result.add_option("--cat", help="Print the source of the tests",
default=False, action="store_true")
result.add_option("--warn-unused", help="Report unused rules",
default=False, action="store_true")
result.add_option("-j", help="The number of parallel tasks to run",
default=1, type="int")
result.add_option("--time", help="Print timing information after running",
default=False, action="store_true")
result.add_option("--suppress-dialogs", help="Suppress Windows dialogs for crashing tests",
dest="suppress_dialogs", default=True, action="store_true")
result.add_option("--no-suppress-dialogs", help="Display Windows dialogs for crashing tests",
dest="suppress_dialogs", action="store_false")
result.add_option("--isolates", help="Whether to test isolates", default=False, action="store_true")
result.add_option("--store-unexpected-output",
help="Store the temporary JS files from tests that fails",
dest="store_unexpected_output", default=True, action="store_true")
result.add_option("--no-store-unexpected-output",
help="Deletes the temporary JS files from tests that fails",
dest="store_unexpected_output", action="store_false")
result.add_option("--stress-only",
help="Only run tests with --always-opt --stress-opt",
default=False, action="store_true")
result.add_option("--nostress",
help="Don't run crankshaft --always-opt --stress-op test",
default=False, action="store_true")
result.add_option("--crankshaft",
help="Run with the --crankshaft flag",
default=False, action="store_true")
result.add_option("--shard-count",
help="Split testsuites into this number of shards",
default=1, type="int")
result.add_option("--shard-run",
help="Run this shard from the split up tests.",
default=1, type="int")
result.add_option("--noprof", help="Disable profiling support",
default=False)
# Flags present in the original test.py that are unsupported in this wrapper:
# -S [-> scons_flags] (we build with gyp/make, not scons)
# --no-build (always true)
# --build-only (always false)
# --build-system (always 'gyp')
# --simulator (always true if arch==arm, always false otherwise)
# --shell (automatically chosen depending on arch and mode)
return result
def ProcessOptions(options):
if options.arch_and_mode != None and options.arch_and_mode != "":
tokens = options.arch_and_mode.split(".")
options.arch = tokens[0]
options.mode = tokens[1]
options.mode = options.mode.split(',')
for mode in options.mode:
if not mode in ['debug', 'release']:
print "Unknown mode %s" % mode
return False
options.arch = options.arch.split(',')
for arch in options.arch:
if not arch in ['ia32', 'x64', 'arm']:
print "Unknown architecture %s" % arch
return False
return True
def PassOnOptions(options):
result = []
if options.verbose:
result += ['--verbose']
if options.progress != 'mono':
result += ['--progress=' + options.progress]
if options.report:
result += ['--report']
if options.suite != []:
for suite in options.suite:
result += ['--suite=../../test/' + suite]
if options.timeout != 60:
result += ['--timeout=%s' % options.timeout]
if options.snapshot:
result += ['--snapshot']
if options.special_command:
result += ['--special-command=' + options.special_command]
if options.valgrind:
result += ['--valgrind']
if options.cat:
result += ['--cat']
if options.warn_unused:
result += ['--warn-unused']
if options.j != 1:
result += ['-j%s' % options.j]
if options.time:
result += ['--time']
if not options.suppress_dialogs:
result += ['--no-suppress-dialogs']
if options.isolates:
result += ['--isolates']
if not options.store_unexpected_output:
result += ['--no-store-unexpected_output']
if options.stress_only:
result += ['--stress-only']
if options.nostress:
result += ['--nostress']
if options.crankshaft:
result += ['--crankshaft']
if options.shard_count != 1:
result += ['--shard_count=%s' % options.shard_count]
if options.shard_run != 1:
result += ['--shard_run=%s' % options.shard_run]
if options.noprof:
result += ['--noprof']
return result
def Main():
parser = BuildOptions()
(options, args) = parser.parse_args()
if not ProcessOptions(options):
parser.print_help()
return 1
workspace = abspath(join(dirname(sys.argv[0]), '..'))
args_for_children = [workspace + '/tools/test.py'] + PassOnOptions(options)
args_for_children += ['--no-build', '--build-system=gyp']
for arg in args:
args_for_children += [arg]
returncodes = 0
for mode in options.mode:
for arch in options.arch:
print ">>> running tests for %s.%s" % (arch, mode)
shell = workspace + '/out/' + arch + '.' + mode + "/shell"
child = subprocess.Popen(' '.join(args_for_children +
['--mode=' + mode] +
['--shell=' + shell]),
shell=True,
cwd=workspace)
returncodes += child.wait()
return returncodes
if __name__ == '__main__':
sys.exit(Main())

View File

@ -1181,8 +1181,6 @@ def BuildOptions():
default=False, action="store_true")
result.add_option("--build-only", help="Only build requirements, don't run the tests",
default=False, action="store_true")
result.add_option("--build-system", help="Build system in use (scons or gyp)",
default='scons')
result.add_option("--report", help="Print a summary of the tests to be run",
default=False, action="store_true")
result.add_option("-s", "--suite", help="A test suite",
@ -1282,10 +1280,6 @@ def ProcessOptions(options):
if options.noprof:
options.scons_flags.append("prof=off")
options.scons_flags.append("profilingsupport=off")
if options.build_system == 'gyp':
if options.build_only:
print "--build-only not supported for gyp, please build manually."
options.build_only = False
return True
@ -1405,9 +1399,6 @@ def Main():
run_valgrind = join(workspace, "tools", "run-valgrind.py")
options.special_command = "python -u " + run_valgrind + " @"
if options.build_system == 'gyp':
SUFFIX['debug'] = ''
shell = abspath(options.shell)
buildspace = dirname(shell)