mirror of https://github.com/lukechilds/node.git
isaacs
12 years ago
105 changed files with 1048 additions and 6519 deletions
File diff suppressed because it is too large
@ -1,38 +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. |
|||
|
|||
from os.path import join |
|||
Import('context tools') |
|||
|
|||
def ConfigureObjectFiles(): |
|||
env = Environment(tools=tools) |
|||
env.Replace(**context.flags['preparser']) |
|||
context.ApplyEnvOverrides(env) |
|||
return env.Object('preparser-process.cc') |
|||
|
|||
preparser_object = ConfigureObjectFiles() |
|||
Return('preparser_object') |
@ -1,38 +0,0 @@ |
|||
# Copyright 2008 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. |
|||
|
|||
from os.path import join |
|||
Import('sample context tools') |
|||
|
|||
def ConfigureObjectFiles(): |
|||
env = Environment(tools=tools) |
|||
env.Replace(**context.flags['sample']) |
|||
context.ApplyEnvOverrides(env) |
|||
return env.Object(sample + '.cc') |
|||
|
|||
sample_object = ConfigureObjectFiles() |
|||
Return('sample_object') |
@ -1,413 +0,0 @@ |
|||
# Copyright 2012 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. |
|||
|
|||
import sys |
|||
from os.path import join, dirname, abspath |
|||
root_dir = dirname(File('SConstruct').rfile().abspath) |
|||
sys.path.append(join(root_dir, 'tools')) |
|||
import js2c |
|||
Import('context') |
|||
Import('tools') |
|||
Import('d8_env') |
|||
|
|||
|
|||
SOURCES = { |
|||
'all': Split(""" |
|||
accessors.cc |
|||
allocation.cc |
|||
api.cc |
|||
assembler.cc |
|||
ast.cc |
|||
atomicops_internals_x86_gcc.cc |
|||
bignum-dtoa.cc |
|||
bignum.cc |
|||
bootstrapper.cc |
|||
builtins.cc |
|||
cached-powers.cc |
|||
checks.cc |
|||
circular-queue.cc |
|||
code-stubs.cc |
|||
codegen.cc |
|||
compilation-cache.cc |
|||
compiler.cc |
|||
contexts.cc |
|||
conversions.cc |
|||
counters.cc |
|||
cpu-profiler.cc |
|||
data-flow.cc |
|||
date.cc |
|||
dateparser.cc |
|||
debug-agent.cc |
|||
debug.cc |
|||
deoptimizer.cc |
|||
disassembler.cc |
|||
diy-fp.cc |
|||
dtoa.cc |
|||
elements-kind.cc |
|||
elements.cc |
|||
execution.cc |
|||
extensions/externalize-string-extension.cc |
|||
extensions/gc-extension.cc |
|||
extensions/statistics-extension.cc |
|||
factory.cc |
|||
fast-dtoa.cc |
|||
fixed-dtoa.cc |
|||
flags.cc |
|||
frames.cc |
|||
full-codegen.cc |
|||
func-name-inferrer.cc |
|||
gdb-jit.cc |
|||
global-handles.cc |
|||
handles.cc |
|||
heap-profiler.cc |
|||
heap-snapshot-generator.cc |
|||
heap.cc |
|||
hydrogen-instructions.cc |
|||
hydrogen.cc |
|||
ic.cc |
|||
incremental-marking.cc |
|||
interface.cc |
|||
interpreter-irregexp.cc |
|||
isolate.cc |
|||
jsregexp.cc |
|||
lithium-allocator.cc |
|||
lithium.cc |
|||
liveedit.cc |
|||
log-utils.cc |
|||
log.cc |
|||
mark-compact.cc |
|||
messages.cc |
|||
objects-printer.cc |
|||
objects-visiting.cc |
|||
objects.cc |
|||
once.cc |
|||
optimizing-compiler-thread.cc |
|||
parser.cc |
|||
preparse-data.cc |
|||
preparser.cc |
|||
profile-generator.cc |
|||
property.cc |
|||
regexp-macro-assembler-irregexp.cc |
|||
regexp-macro-assembler.cc |
|||
regexp-stack.cc |
|||
rewriter.cc |
|||
runtime-profiler.cc |
|||
runtime.cc |
|||
safepoint-table.cc |
|||
scanner-character-streams.cc |
|||
scanner.cc |
|||
scopeinfo.cc |
|||
scopes.cc |
|||
serialize.cc |
|||
snapshot-common.cc |
|||
spaces.cc |
|||
store-buffer.cc |
|||
string-search.cc |
|||
string-stream.cc |
|||
strtod.cc |
|||
stub-cache.cc |
|||
token.cc |
|||
transitions.cc |
|||
type-info.cc |
|||
unicode.cc |
|||
utils.cc |
|||
v8-counters.cc |
|||
v8.cc |
|||
v8conversions.cc |
|||
v8threads.cc |
|||
v8utils.cc |
|||
variables.cc |
|||
version.cc |
|||
zone.cc |
|||
"""), |
|||
'arch:arm': Split(""" |
|||
arm/builtins-arm.cc |
|||
arm/code-stubs-arm.cc |
|||
arm/codegen-arm.cc |
|||
arm/constants-arm.cc |
|||
arm/cpu-arm.cc |
|||
arm/debug-arm.cc |
|||
arm/deoptimizer-arm.cc |
|||
arm/disasm-arm.cc |
|||
arm/frames-arm.cc |
|||
arm/full-codegen-arm.cc |
|||
arm/ic-arm.cc |
|||
arm/lithium-arm.cc |
|||
arm/lithium-codegen-arm.cc |
|||
arm/lithium-gap-resolver-arm.cc |
|||
arm/macro-assembler-arm.cc |
|||
arm/regexp-macro-assembler-arm.cc |
|||
arm/stub-cache-arm.cc |
|||
arm/assembler-arm.cc |
|||
"""), |
|||
'arch:mips': Split(""" |
|||
mips/assembler-mips.cc |
|||
mips/builtins-mips.cc |
|||
mips/code-stubs-mips.cc |
|||
mips/codegen-mips.cc |
|||
mips/constants-mips.cc |
|||
mips/cpu-mips.cc |
|||
mips/debug-mips.cc |
|||
mips/deoptimizer-mips.cc |
|||
mips/disasm-mips.cc |
|||
mips/frames-mips.cc |
|||
mips/full-codegen-mips.cc |
|||
mips/ic-mips.cc |
|||
mips/lithium-codegen-mips.cc |
|||
mips/lithium-gap-resolver-mips.cc |
|||
mips/lithium-mips.cc |
|||
mips/macro-assembler-mips.cc |
|||
mips/regexp-macro-assembler-mips.cc |
|||
mips/stub-cache-mips.cc |
|||
"""), |
|||
'arch:ia32': Split(""" |
|||
ia32/assembler-ia32.cc |
|||
ia32/builtins-ia32.cc |
|||
ia32/code-stubs-ia32.cc |
|||
ia32/codegen-ia32.cc |
|||
ia32/cpu-ia32.cc |
|||
ia32/debug-ia32.cc |
|||
ia32/deoptimizer-ia32.cc |
|||
ia32/disasm-ia32.cc |
|||
ia32/frames-ia32.cc |
|||
ia32/full-codegen-ia32.cc |
|||
ia32/ic-ia32.cc |
|||
ia32/lithium-codegen-ia32.cc |
|||
ia32/lithium-gap-resolver-ia32.cc |
|||
ia32/lithium-ia32.cc |
|||
ia32/macro-assembler-ia32.cc |
|||
ia32/regexp-macro-assembler-ia32.cc |
|||
ia32/stub-cache-ia32.cc |
|||
"""), |
|||
'arch:x64': Split(""" |
|||
x64/assembler-x64.cc |
|||
x64/builtins-x64.cc |
|||
x64/code-stubs-x64.cc |
|||
x64/codegen-x64.cc |
|||
x64/cpu-x64.cc |
|||
x64/debug-x64.cc |
|||
x64/deoptimizer-x64.cc |
|||
x64/disasm-x64.cc |
|||
x64/frames-x64.cc |
|||
x64/full-codegen-x64.cc |
|||
x64/ic-x64.cc |
|||
x64/lithium-codegen-x64.cc |
|||
x64/lithium-gap-resolver-x64.cc |
|||
x64/lithium-x64.cc |
|||
x64/macro-assembler-x64.cc |
|||
x64/regexp-macro-assembler-x64.cc |
|||
x64/stub-cache-x64.cc |
|||
"""), |
|||
'simulator:arm': ['arm/simulator-arm.cc'], |
|||
'simulator:mips': ['mips/simulator-mips.cc'], |
|||
'os:freebsd': ['platform-freebsd.cc', 'platform-posix.cc'], |
|||
'os:openbsd': ['platform-openbsd.cc', 'platform-posix.cc'], |
|||
'os:linux': ['platform-linux.cc', 'platform-posix.cc'], |
|||
'os:android': ['platform-linux.cc', 'platform-posix.cc'], |
|||
'os:macos': ['platform-macos.cc', 'platform-posix.cc'], |
|||
'os:solaris': ['platform-solaris.cc', 'platform-posix.cc'], |
|||
'os:cygwin': ['platform-cygwin.cc', 'platform-posix.cc'], |
|||
'os:nullos': ['platform-nullos.cc'], |
|||
'os:win32': ['platform-win32.cc', 'win32-math.cc'], |
|||
'mode:release': [], |
|||
'mode:debug': [ |
|||
'objects-debug.cc', 'prettyprinter.cc', 'regexp-macro-assembler-tracer.cc' |
|||
] |
|||
} |
|||
|
|||
|
|||
PREPARSER_SOURCES = { |
|||
'all': Split(""" |
|||
allocation.cc |
|||
bignum.cc |
|||
bignum-dtoa.cc |
|||
cached-powers.cc |
|||
conversions.cc |
|||
diy-fp.cc |
|||
dtoa.cc |
|||
fast-dtoa.cc |
|||
fixed-dtoa.cc |
|||
preparse-data.cc |
|||
preparser.cc |
|||
preparser-api.cc |
|||
scanner.cc |
|||
strtod.cc |
|||
token.cc |
|||
unicode.cc |
|||
utils.cc |
|||
"""), |
|||
'os:win32': ['win32-math.cc'] |
|||
} |
|||
|
|||
|
|||
D8_LIGHT_FILES = { |
|||
'all': [ |
|||
'd8.cc' |
|||
] |
|||
} |
|||
|
|||
|
|||
D8_FULL_FILES = { |
|||
'all': [ |
|||
'd8.cc', 'd8-debug.cc' |
|||
], |
|||
'os:linux': [ |
|||
'd8-posix.cc' |
|||
], |
|||
'os:macos': [ |
|||
'd8-posix.cc' |
|||
], |
|||
'os:android': [ |
|||
'd8-posix.cc' |
|||
], |
|||
'os:freebsd': [ |
|||
'd8-posix.cc' |
|||
], |
|||
'os:openbsd': [ |
|||
'd8-posix.cc' |
|||
], |
|||
'os:solaris': [ |
|||
'd8-posix.cc' |
|||
], |
|||
'os:cygwin': [ |
|||
'd8-posix.cc' |
|||
], |
|||
'os:win32': [ |
|||
'd8-windows.cc' |
|||
], |
|||
'os:nullos': [ |
|||
'd8-windows.cc' # Empty implementation at the moment. |
|||
], |
|||
'console:readline': [ |
|||
'd8-readline.cc' |
|||
] |
|||
} |
|||
|
|||
|
|||
LIBRARY_FILES = ''' |
|||
runtime.js |
|||
v8natives.js |
|||
array.js |
|||
string.js |
|||
uri.js |
|||
math.js |
|||
messages.js |
|||
apinatives.js |
|||
date.js |
|||
regexp.js |
|||
json.js |
|||
liveedit-debugger.js |
|||
mirror-debugger.js |
|||
debug-debugger.js |
|||
'''.split() |
|||
|
|||
|
|||
EXPERIMENTAL_LIBRARY_FILES = ''' |
|||
symbol.js |
|||
proxy.js |
|||
collection.js |
|||
'''.split() |
|||
|
|||
|
|||
def Abort(message): |
|||
print message |
|||
sys.exit(1) |
|||
|
|||
|
|||
def ConfigureObjectFiles(): |
|||
env = Environment(tools=tools) |
|||
env.Replace(**context.flags['v8']) |
|||
context.ApplyEnvOverrides(env) |
|||
env['BUILDERS']['JS2C'] = Builder(action=js2c.JS2C) |
|||
env['BUILDERS']['Snapshot'] = Builder(action='$SOURCE $TARGET --logfile "$LOGFILE" --log-snapshot-positions') |
|||
|
|||
def BuildJS2CEnv(type): |
|||
js2c_env = { 'TYPE': type, 'COMPRESSION': 'off' } |
|||
if 'COMPRESS_STARTUP_DATA_BZ2' in env['CPPDEFINES']: |
|||
js2c_env['COMPRESSION'] = 'bz2' |
|||
return js2c_env |
|||
|
|||
# Build the standard platform-independent source files. |
|||
source_files = context.GetRelevantSources(SOURCES) |
|||
d8_js = env.JS2C('d8-js.cc', 'd8.js', **{'TYPE': 'D8', 'COMPRESSION': 'off'}) |
|||
d8_js_obj = context.ConfigureObject(env, d8_js, CPPPATH=['.']) |
|||
if context.options['library'] == 'shared': |
|||
d8_files = context.GetRelevantSources(D8_LIGHT_FILES) |
|||
d8_objs = [] |
|||
else: |
|||
d8_files = context.GetRelevantSources(D8_FULL_FILES) |
|||
d8_objs = [d8_js_obj] |
|||
d8_objs.append(context.ConfigureObject(d8_env, [d8_files])) |
|||
|
|||
# Combine the JavaScript library files into a single C++ file and |
|||
# compile it. |
|||
library_files = [s for s in LIBRARY_FILES] |
|||
library_files.append('macros.py') |
|||
libraries_src = env.JS2C( |
|||
['libraries.cc'], library_files, **BuildJS2CEnv('CORE')) |
|||
libraries_obj = context.ConfigureObject(env, libraries_src, CPPPATH=['.']) |
|||
|
|||
# Combine the experimental JavaScript library files into a C++ file |
|||
# and compile it. |
|||
experimental_library_files = [ s for s in EXPERIMENTAL_LIBRARY_FILES ] |
|||
experimental_library_files.append('macros.py') |
|||
experimental_libraries_src = env.JS2C(['experimental-libraries.cc'], |
|||
experimental_library_files, |
|||
**BuildJS2CEnv('EXPERIMENTAL')) |
|||
experimental_libraries_obj = context.ConfigureObject(env, experimental_libraries_src, CPPPATH=['.']) |
|||
|
|||
source_objs = context.ConfigureObject(env, source_files) |
|||
non_snapshot_files = [source_objs] |
|||
|
|||
preparser_source_files = context.GetRelevantSources(PREPARSER_SOURCES) |
|||
preparser_objs = context.ConfigureObject(env, preparser_source_files) |
|||
|
|||
# Create snapshot if necessary. For cross compilation you should either |
|||
# do without snapshots and take the performance hit or you should build a |
|||
# host VM with the simulator=arm and snapshot=on options and then take the |
|||
# resulting snapshot.cc file from obj/release and put it in the src |
|||
# directory. Then rebuild the VM with the cross compiler and specify |
|||
# snapshot=nobuild on the scons command line. |
|||
empty_snapshot_obj = context.ConfigureObject(env, 'snapshot-empty.cc') |
|||
mksnapshot_env = env.Copy() |
|||
mksnapshot_env.Replace(**context.flags['mksnapshot']) |
|||
mksnapshot_src = 'mksnapshot.cc' |
|||
mksnapshot = mksnapshot_env.Program('mksnapshot', [mksnapshot_src, libraries_obj, experimental_libraries_obj, non_snapshot_files, empty_snapshot_obj], PDB='mksnapshot.exe.pdb') |
|||
if context.use_snapshot: |
|||
if context.build_snapshot: |
|||
snapshot_cc = env.Snapshot('snapshot.cc', mksnapshot, LOGFILE=File('snapshot.log').abspath) |
|||
else: |
|||
snapshot_cc = 'snapshot.cc' |
|||
snapshot_obj = context.ConfigureObject(env, snapshot_cc, CPPPATH=['.']) |
|||
else: |
|||
snapshot_obj = empty_snapshot_obj |
|||
library_objs = [non_snapshot_files, libraries_obj, experimental_libraries_obj, snapshot_obj] |
|||
return (library_objs, d8_objs, [mksnapshot], preparser_objs) |
|||
|
|||
|
|||
(library_objs, d8_objs, mksnapshot, preparser_objs) = ConfigureObjectFiles() |
|||
Return('library_objs d8_objs mksnapshot preparser_objs') |
@ -1,105 +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. |
|||
|
|||
|
|||
import test |
|||
import os |
|||
from os.path import join, split |
|||
|
|||
def GetSuite(name, root): |
|||
# Not implemented. |
|||
return None |
|||
|
|||
|
|||
def IsNumber(string): |
|||
try: |
|||
float(string) |
|||
return True |
|||
except ValueError: |
|||
return False |
|||
|
|||
|
|||
class BenchmarkTestCase(test.TestCase): |
|||
|
|||
def __init__(self, path, context, mode): |
|||
super(BenchmarkTestCase, self).__init__(context, split(path), mode) |
|||
self.root = path |
|||
|
|||
def GetLabel(self): |
|||
return '%s benchmark %s' % (self.mode, self.GetName()) |
|||
|
|||
def IsFailureOutput(self, output): |
|||
if output.exit_code != 0: |
|||
return True |
|||
lines = output.stdout.splitlines() |
|||
for line in lines: |
|||
colon_index = line.find(':') |
|||
if colon_index >= 0: |
|||
if not IsNumber(line[colon_index+1:].strip()): |
|||
return True |
|||
return False |
|||
|
|||
def GetCommand(self): |
|||
result = self.context.GetVmCommand(self, self.mode) |
|||
result.append(join(self.root, 'run.js')) |
|||
return result |
|||
|
|||
def GetName(self): |
|||
return 'V8' |
|||
|
|||
def BeforeRun(self): |
|||
os.chdir(self.root) |
|||
|
|||
def AfterRun(self, result): |
|||
os.chdir(self.context.buildspace) |
|||
|
|||
def GetSource(self): |
|||
return open(join(self.root, 'run.js')).read() |
|||
|
|||
def GetCustomFlags(self, mode): |
|||
return [] |
|||
|
|||
|
|||
class BenchmarkTestConfiguration(test.TestConfiguration): |
|||
|
|||
def __init__(self, context, root): |
|||
super(BenchmarkTestConfiguration, self).__init__(context, root) |
|||
|
|||
def ListTests(self, current_path, path, mode, variant_flags): |
|||
path = self.context.workspace |
|||
path = join(path, 'benchmarks') |
|||
test = BenchmarkTestCase(path, self.context, mode) |
|||
return [test] |
|||
|
|||
def GetBuildRequirements(self): |
|||
return ['d8'] |
|||
|
|||
def GetTestStatus(self, sections, defs): |
|||
pass |
|||
|
|||
def GetConfiguration(context, root): |
|||
return BenchmarkTestConfiguration(context, root) |
@ -1,152 +0,0 @@ |
|||
# Copyright 2012 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. |
|||
|
|||
import sys |
|||
from os.path import join, dirname, abspath |
|||
root_dir = dirname(File('SConstruct').rfile().abspath) |
|||
sys.path.append(join(root_dir, 'tools')) |
|||
import js2c |
|||
Import('context object_files tools') |
|||
|
|||
|
|||
# Needed for test-log. Paths are relative to the cctest dir. |
|||
JS_FILES_FOR_TESTS = [ |
|||
'../../../tools/splaytree.js', |
|||
'../../../tools/codemap.js', |
|||
'../../../tools/csvparser.js', |
|||
'../../../tools/consarray.js', |
|||
'../../../tools/profile.js', |
|||
'../../../tools/profile_view.js', |
|||
'../../../tools/logreader.js', |
|||
'log-eq-of-logging-and-traversal.js', |
|||
] |
|||
|
|||
|
|||
SOURCES = { |
|||
'all': [ |
|||
'gay-fixed.cc', |
|||
'gay-precision.cc', |
|||
'gay-shortest.cc', |
|||
'test-accessors.cc', |
|||
'test-alloc.cc', |
|||
'test-api.cc', |
|||
'test-ast.cc', |
|||
'test-bignum-dtoa.cc', |
|||
'test-bignum.cc', |
|||
'test-circular-queue.cc', |
|||
'test-compiler.cc', |
|||
'test-conversions.cc', |
|||
'test-cpu-profiler.cc', |
|||
'test-dataflow.cc', |
|||
'test-date.cc', |
|||
'test-debug.cc', |
|||
'test-declarative-accessors.cc', |
|||
'test-decls.cc', |
|||
'test-deoptimization.cc', |
|||
'test-dictionary.cc', |
|||
'test-diy-fp.cc', |
|||
'test-double.cc', |
|||
'test-dtoa.cc', |
|||
'test-fast-dtoa.cc', |
|||
'test-fixed-dtoa.cc', |
|||
'test-flags.cc', |
|||
'test-func-name-inference.cc', |
|||
'test-hashing.cc', |
|||
'test-hashmap.cc', |
|||
'test-heap-profiler.cc', |
|||
'test-heap.cc', |
|||
'test-list.cc', |
|||
'test-liveedit.cc', |
|||
'test-lock.cc', |
|||
'test-lockers.cc', |
|||
'test-log.cc', |
|||
'test-mark-compact.cc', |
|||
'test-parsing.cc', |
|||
'test-platform-tls.cc', |
|||
'test-profile-generator.cc', |
|||
'test-random.cc', |
|||
'test-regexp.cc', |
|||
'test-reloc-info.cc', |
|||
'test-serialize.cc', |
|||
'test-sockets.cc', |
|||
'test-spaces.cc', |
|||
'test-strings.cc', |
|||
'test-symbols.cc', |
|||
'test-strtod.cc', |
|||
'test-thread-termination.cc', |
|||
'test-threads.cc', |
|||
'test-unbound-queue.cc', |
|||
'test-utils.cc', |
|||
'test-version.cc', |
|||
'test-weakmaps.cc' |
|||
], |
|||
'arch:arm': [ |
|||
'test-assembler-arm.cc', |
|||
'test-disasm-arm.cc' |
|||
], |
|||
'arch:ia32': [ |
|||
'test-assembler-ia32.cc', |
|||
'test-disasm-ia32.cc', |
|||
'test-log-stack-tracer.cc' |
|||
], |
|||
'arch:x64': ['test-assembler-x64.cc', |
|||
'test-macro-assembler-x64.cc', |
|||
'test-log-stack-tracer.cc', |
|||
'test-disasm-x64.cc'], |
|||
'arch:mips': ['test-assembler-mips.cc', |
|||
'test-disasm-mips.cc'], |
|||
'os:linux': ['test-platform-linux.cc'], |
|||
'os:macos': ['test-platform-macos.cc'], |
|||
'os:nullos': ['test-platform-nullos.cc'], |
|||
'os:win32': ['test-platform-win32.cc'] |
|||
} |
|||
|
|||
|
|||
def Build(): |
|||
cctest_files = context.GetRelevantSources(SOURCES) |
|||
env = Environment(tools=tools) |
|||
env.Replace(**context.flags['cctest']) |
|||
context.ApplyEnvOverrides(env) |
|||
env['BUILDERS']['JS2C'] = Builder(action=js2c.JS2C) |
|||
|
|||
# Combine the JavaScript library files into a single C++ file and |
|||
# compile it. |
|||
js_files = [s for s in JS_FILES_FOR_TESTS] |
|||
js_files_src = env.JS2C( |
|||
['js-files-for-cctest.cc'], js_files, **{'TYPE': 'TEST', 'COMPRESSION': 'off'}) |
|||
js_files_obj = context.ConfigureObject(env, js_files_src, CPPPATH=['.']) |
|||
|
|||
# There seems to be a glitch in the way scons decides where to put |
|||
# PDB files when compiling using MSVC so we specify it manually. |
|||
# This should not affect any other platforms. |
|||
object_files.append(js_files_obj) |
|||
return env.Program('cctest', ['cctest.cc', cctest_files, object_files], |
|||
PDB='cctest.exe.pdb') |
|||
|
|||
|
|||
program = Build() |
|||
Return('program') |
@ -1,14 +0,0 @@ |
|||
This directory contains code for binding the es5conform test suite |
|||
into the v8 test harness. To use the tests check out the es5conform |
|||
tests from |
|||
|
|||
https://es5conform.svn.codeplex.com/svn |
|||
|
|||
in revision 71525 as 'data' in this directory. Using later version |
|||
may be possible but the tests are only known to pass (and indeed run) |
|||
with that revision. |
|||
|
|||
If you do update to a newer revision you may have to change the test |
|||
harness adapter code since it uses internal functionality from the |
|||
harness that comes bundled with the tests. You will most likely also |
|||
have to update the test expectation file. |
@ -1,316 +0,0 @@ |
|||
# Copyright 2009 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. |
|||
|
|||
prefix es5conform |
|||
def UNIMPLEMENTED = PASS || FAIL |
|||
def FAIL_OK = FAIL, OKAY |
|||
|
|||
|
|||
############################################################################## |
|||
# Non UTF8 characters in test files. |
|||
chapter10/10.4/10.4.2/10.4.2-3-c-2-s: FAIL_OK |
|||
chapter10/10.4/10.4.2/10.4.2-3-c-1-s: FAIL_OK |
|||
chapter10/10.4/10.4.2/10.4.2-2-c-1: FAIL_OK |
|||
|
|||
# We do not implement the error chekcs specified in the production rules |
|||
# of 11.1.5 (Object initializer). |
|||
# We are compatible with Safari and Firefox. |
|||
chapter11/11.1/11.1.5: UNIMPLEMENTED |
|||
|
|||
# Our Function object has an "arguments" property which is used as a |
|||
# non-property in the test. |
|||
chapter15/15.2/15.2.3/15.2.3.3/15.2.3.3-4-183: FAIL_OK |
|||
|
|||
# Our Function object has a "caller" property which is used as a |
|||
# non-property in in the test. |
|||
chapter15/15.2/15.2.3/15.2.3.3/15.2.3.3-4-184: FAIL_OK |
|||
|
|||
# Our function object has a name property which is used as a |
|||
# non-property in the test. |
|||
chapter15/15.2/15.2.3/15.2.3.3/15.2.3.3-4-188: FAIL_OK |
|||
|
|||
# NOT IMPLEMENTED: RegExp.prototype.source |
|||
chapter15/15.2/15.2.3/15.2.3.3/15.2.3.3-4-212: UNIMPLEMENTED |
|||
|
|||
# NOT IMPLEMENTED: RegExp.prototype.global |
|||
chapter15/15.2/15.2.3/15.2.3.3/15.2.3.3-4-213: UNIMPLEMENTED |
|||
|
|||
# NOT IMPLEMENTED: RegExp.prototype.ignoreCase |
|||
chapter15/15.2/15.2.3/15.2.3.3/15.2.3.3-4-214: UNIMPLEMENTED |
|||
|
|||
# NOT IMPLEMENTED: RegExp.prototype.multiline |
|||
chapter15/15.2/15.2.3/15.2.3.3/15.2.3.3-4-215: UNIMPLEMENTED |
|||
|
|||
# All of the tests below marked SUBSETFAIL (in 15.2.3.4) fail because |
|||
# the tests assumes that objects can not have more properties |
|||
# than those described in the spec - but according to spec they can |
|||
# have additional properties. |
|||
# All compareArray calls in these tests could be exchanged with a |
|||
# isSubsetOfArray call (I will upload a patch to the es5conform site). |
|||
|
|||
# SUBSETFAIL |
|||
chapter15/15.2/15.2.3/15.2.3.4/15.2.3.4-4-1: FAIL_OK |
|||
|
|||
# SUBSETFAIL + we do not implement all methods on Object. |
|||
chapter15/15.2/15.2.3/15.2.3.4/15.2.3.4-4-2: FAIL_OK |
|||
|
|||
# SUBSETFAIL |
|||
chapter15/15.2/15.2.3/15.2.3.4/15.2.3.4-4-3: FAIL_OK |
|||
|
|||
# SUBSETFAIL |
|||
chapter15/15.2/15.2.3/15.2.3.4/15.2.3.4-4-4: FAIL_OK |
|||
|
|||
# SUBSETFAIL |
|||
chapter15/15.2/15.2.3/15.2.3.4/15.2.3.4-4-5: FAIL_OK |
|||
|
|||
# SUBSETFAIL |
|||
chapter15/15.2/15.2.3/15.2.3.4/15.2.3.4-4-6: FAIL_OK |
|||
|
|||
# SUBSETFAIL |
|||
chapter15/15.2/15.2.3/15.2.3.4/15.2.3.4-4-7: FAIL_OK |
|||
|
|||
# SUBSETFAIL |
|||
chapter15/15.2/15.2.3/15.2.3.4/15.2.3.4-4-11: FAIL_OK |
|||
|
|||
# SUBSETFAIL |
|||
chapter15/15.2/15.2.3/15.2.3.4/15.2.3.4-4-14: FAIL_OK |
|||
|
|||
# EvalError.prototype does not have message property. |
|||
chapter15/15.2/15.2.3/15.2.3.4/15.2.3.4-4-15: FAIL |
|||
|
|||
# Rangeerror.prototype does not have message property. |
|||
chapter15/15.2/15.2.3/15.2.3.4/15.2.3.4-4-16: FAIL |
|||
|
|||
# ReferenceError.prototype does not have message property. |
|||
chapter15/15.2/15.2.3/15.2.3.4/15.2.3.4-4-17: FAIL |
|||
|
|||
# SyntaxError.prototype does not have message property. |
|||
chapter15/15.2/15.2.3/15.2.3.4/15.2.3.4-4-18: FAIL |
|||
|
|||
# TypeError.prototype does not have message property. |
|||
chapter15/15.2/15.2.3/15.2.3.4/15.2.3.4-4-19: FAIL |
|||
|
|||
# URIError.prototype does not have message property. |
|||
chapter15/15.2/15.2.3/15.2.3.4/15.2.3.4-4-20: FAIL |
|||
|
|||
# SUBSETFAIL |
|||
chapter15/15.2/15.2.3/15.2.3.4/15.2.3.4-4-22: FAIL_OK |
|||
|
|||
# SUBSETFAIL |
|||
chapter15/15.2/15.2.3/15.2.3.4/15.2.3.4-4-23: FAIL_OK |
|||
|
|||
# SUBSETFAIL |
|||
chapter15/15.2/15.2.3/15.2.3.4/15.2.3.4-4-24: FAIL_OK |
|||
|
|||
# SUBSETFAIL |
|||
chapter15/15.2/15.2.3/15.2.3.4/15.2.3.4-4-25: FAIL_OK |
|||
|
|||
# SUBSETFAIL |
|||
chapter15/15.2/15.2.3/15.2.3.4/15.2.3.4-4-26: FAIL_OK |
|||
|
|||
# SUBSETFAIL |
|||
chapter15/15.2/15.2.3/15.2.3.4/15.2.3.4-4-27: FAIL_OK |
|||
|
|||
# SUBSETFAIL |
|||
chapter15/15.2/15.2.3/15.2.3.4/15.2.3.4-4-28: FAIL_OK |
|||
|
|||
# SUBSETFAIL |
|||
chapter15/15.2/15.2.3/15.2.3.4/15.2.3.4-4-29: FAIL_OK |
|||
|
|||
# SUBSETFAIL |
|||
chapter15/15.2/15.2.3/15.2.3.4/15.2.3.4-4-30: FAIL_OK |
|||
|
|||
# SUBSETFAIL |
|||
chapter15/15.2/15.2.3/15.2.3.4/15.2.3.4-4-31: FAIL_OK |
|||
|
|||
# SUBSETFAIL |
|||
chapter15/15.2/15.2.3/15.2.3.4/15.2.3.4-4-32: FAIL_OK |
|||
|
|||
# SUBSETFAIL |
|||
chapter15/15.2/15.2.3/15.2.3.4/15.2.3.4-4-33: FAIL_OK |
|||
|
|||
# SUBSETFAIL |
|||
chapter15/15.2/15.2.3/15.2.3.4/15.2.3.4-4-34: FAIL_OK |
|||
|
|||
# SUBSETFAIL |
|||
chapter15/15.2/15.2.3/15.2.3.4/15.2.3.4-4-35: FAIL_OK |
|||
|
|||
# Bad test - the test at the end should be "i === true". |
|||
chapter15/15.4/15.4.4/15.4.4.17/15.4.4.17-8-10: FAIL_OK |
|||
|
|||
# Bad test - according to spec some returns a Boolean, not a number. |
|||
chapter15/15.4/15.4.4/15.4.4.17/15.4.4.17-4-9: FAIL_OK |
|||
|
|||
# Bad test - uses unitialized variable a in precondition check. |
|||
chapter15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-3: FAIL_OK |
|||
|
|||
# We do not implement Array mapping functions correctly if array |
|||
# entries are added for nonexistent entries smaller than length by |
|||
# the callback function. We are compatible with JSC. |
|||
# See http://code.google.com/p/v8/issues/detail?id=755 |
|||
chapter15/15.4/15.4.4/15.4.4.22/15.4.4.22-9-1: FAIL_OK |
|||
|
|||
# Bad tests, path in test file is wrong. This will crash the test |
|||
# script so we mark it SKIP. |
|||
chapter15/15.4/15.4.4/15.4.4.22/15.4.4.22-9-c-ii-4: SKIP |
|||
chapter15/15.4/15.4.4/15.4.4.22/15.4.4.22-9-c-ii-4-s: SKIP |
|||
|
|||
# Bad test - deleting the property on o in callbackfn will |
|||
# have no effect on the actual array on which reduceRight is called. |
|||
chapter15/15.4/15.4.4/15.4.4.22/15.4.4.22-9-7: FAIL_OK |
|||
|
|||
############################################################################## |
|||
# Unimplemented parts of strict mode |
|||
# Setting expectations to fail only so that the tests trigger as soon as |
|||
# the strict mode feature gets implemented |
|||
|
|||
# A directive preceeding an 'use strict' directive may not contain |
|||
# an OctalEscapeSequence |
|||
# Incorrect test - need double escape in eval. |
|||
chapter07/7.8/7.8.4/7.8.4-1-s: FAIL |
|||
|
|||
# arguments.caller is non-configurable in strict mode |
|||
# Invalid test case. Checks for "writable == true" and presence of "put".. |
|||
chapter10/10.6/10.6-13-b-3-s: FAIL |
|||
# arguments.callee is non-configurable in strict mode |
|||
# Invalid test case. Checks for "put" property accessor. |
|||
chapter10/10.6/10.6-13-c-3-s: FAIL |
|||
|
|||
# simple assignment throws TypeError if LeftHandSide is a property reference |
|||
# with a primitive base value (this is undefined) |
|||
chapter11/11.13/11.13.1/11.13.1-1-7-s: FAIL |
|||
|
|||
# simple assignment throws TypeError if LeftHandSide is a readonly property |
|||
# in strict mode (Global.NaN) |
|||
chapter11/11.13/11.13.1/11.13.1-4-2-s: FAIL |
|||
# simple assignment throws TypeError if LeftHandSide is a readonly property |
|||
# in strict mode (Global.Infinity) |
|||
chapter11/11.13/11.13.1/11.13.1-4-3-s: FAIL |
|||
# simple assignment throws TypeError if LeftHandSide is a readonly property |
|||
# in strict mode (Global.length) |
|||
chapter11/11.13/11.13.1/11.13.1-4-4-s: FAIL |
|||
# simple assignment throws TypeError if LeftHandSide is a readonly property |
|||
# in strict mode (Global.undefined) |
|||
chapter11/11.13/11.13.1/11.13.1-4-27-s: FAIL |
|||
|
|||
# delete operator throws TypeError when when deleting a non-configurable |
|||
# data property in strict mode (Global.NaN) |
|||
# Invalid test case - "this" is not a global object within the test case. |
|||
# (http://es5conform.codeplex.com/workitem/29151) |
|||
chapter11/11.4/11.4.1/11.4.1-4.a-4-s: FAIL_OK |
|||
|
|||
# delete operator throws ReferenceError when deleting a direct reference |
|||
# to a var in strict mode |
|||
# Invalid test case. Test expects ReferenceError instead of SyntaxError. |
|||
# http://es5conform.codeplex.com/workitem/29084 |
|||
chapter11/11.4/11.4.1/11.4.1-5-1-s: FAIL |
|||
# delete operator throws ReferenceError when deleting a direct reference |
|||
# to a function argument in strict mode |
|||
# Invalid test case. Test expects ReferenceError instead of SyntaxError. |
|||
# http://es5conform.codeplex.com/workitem/29084 |
|||
chapter11/11.4/11.4.1/11.4.1-5-2-s: FAIL |
|||
# delete operator throws ReferenceError when deleting a direct reference |
|||
# to a function name in strict mode |
|||
# Invalid test case. Test expects ReferenceError instead of SyntaxError. |
|||
# http://es5conform.codeplex.com/workitem/29084 |
|||
chapter11/11.4/11.4.1/11.4.1-5-3-s: FAIL |
|||
|
|||
# eval - a function declaring a var named 'eval' throws EvalError in strict mode |
|||
# Invalid test case. SyntaxError should be expected instead of EvalError. |
|||
chapter12/12.2/12.2.1/12.2.1-1-s: FAIL |
|||
# eval - a function assigning into 'eval' throws EvalError in strict mode |
|||
# Invalid test case. SyntaxError should be expected instead of EvalError. |
|||
chapter12/12.2/12.2.1/12.2.1-2-s: FAIL |
|||
# eval - a function expr declaring a var named 'eval' throws EvalError |
|||
# in strict mode |
|||
# Invalid test case. SyntaxError should be expected instead of EvalError. |
|||
chapter12/12.2/12.2.1/12.2.1-3-s: FAIL |
|||
# eval - a function expr assigning into 'eval' throws a EvalError in strict mode |
|||
# Invalid test case. SyntaxError should be expected instead of EvalError. |
|||
chapter12/12.2/12.2.1/12.2.1-4-s: FAIL |
|||
# eval - a Function declaring var named 'eval' throws EvalError in strict mode |
|||
# Invalid test case. SyntaxError should be expected instead of EvalError. |
|||
chapter12/12.2/12.2.1/12.2.1-5-s: FAIL |
|||
# eval - a Function assigning into 'eval' throws EvalError in strict mode |
|||
# Invalid test case. SyntaxError should be expected instead of EvalError. |
|||
chapter12/12.2/12.2.1/12.2.1-6-s: FAIL |
|||
# eval - a direct eval declaring a var named 'eval' throws EvalError |
|||
# in strict mode |
|||
# Invalid test case. SyntaxError should be expected instead of EvalError. |
|||
chapter12/12.2/12.2.1/12.2.1-7-s: FAIL |
|||
# eval - a direct eval assigning into 'eval' throws EvalError in strict mode |
|||
# Invalid test case. SyntaxError should be expected instead of EvalError. |
|||
chapter12/12.2/12.2.1/12.2.1-8-s: FAIL |
|||
# eval - an indirect eval declaring a var named 'eval' throws EvalError |
|||
# in strict mode |
|||
# Invalid test case. SyntaxError should be expected instead of EvalError. |
|||
chapter12/12.2/12.2.1/12.2.1-9-s: FAIL |
|||
# eval - an indirect eval assigning into 'eval' throws EvalError in strict mode |
|||
# Invalid test case. SyntaxError should be expected instead of EvalError. |
|||
chapter12/12.2/12.2.1/12.2.1-10-s: FAIL |
|||
|
|||
# SyntaxError if eval used as function identifier in function declaration |
|||
# with strict body |
|||
# Test fails to return true on success (invalid test case). |
|||
chapter13/13.1/13.1-3-3-s: FAIL |
|||
# SyntaxError if eval used as function identifier in function expression |
|||
# with strict body |
|||
# Test fails to return true on success (invalid test case). |
|||
chapter13/13.1/13.1-3-4-s: FAIL |
|||
# SyntaxError if eval used as function identifier in function declaration |
|||
# in strict code |
|||
# Test fails to return true on success (invalid test case). |
|||
chapter13/13.1/13.1-3-5-s: FAIL |
|||
# SyntaxError if eval used as function identifier in function expression |
|||
# in strict code |
|||
# Test fails to return true on success (invalid test case). |
|||
chapter13/13.1/13.1-3-6-s: FAIL |
|||
# SyntaxError if arguments used as function identifier in function declaration |
|||
# with strict body |
|||
# Test fails to return true on success (invalid test case). |
|||
chapter13/13.1/13.1-3-9-s: FAIL |
|||
# SyntaxError if arguments used as function identifier in function expression |
|||
# with strict body |
|||
# Test fails to return true on success (invalid test case). |
|||
chapter13/13.1/13.1-3-10-s: FAIL |
|||
# SyntaxError if arguments used as function identifier in function declaration |
|||
# in strict code |
|||
# Test fails to return true on success (invalid test case). |
|||
chapter13/13.1/13.1-3-11-s: FAIL |
|||
# SyntaxError if arguments used as function identifier in function expression |
|||
# in strict code |
|||
# Test fails to return true on success (invalid test case). |
|||
chapter13/13.1/13.1-3-12-s: FAIL |
|||
|
|||
# Duplicate combined parameter name allowed in Function constructor called |
|||
# in strict mode if body not strict |
|||
# Test fails to return true on success (invalid test case). |
|||
chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-6-s: FAIL |
|||
|
|||
# Array.prototype.reduce - null passed as thisValue to strict callbackfn |
|||
# Invalid test case: http://es5conform.codeplex.com/workitem/29085 |
|||
chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-4-s: FAIL |
@ -1,74 +0,0 @@ |
|||
// Copyright 2009 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.
|
|||
|
|||
var global = this; |
|||
|
|||
function ES5Error(ut) { |
|||
this.ut = ut; |
|||
} |
|||
|
|||
ES5Error.prototype.toString = function () { |
|||
return this.ut.res; |
|||
}; |
|||
|
|||
// The harness uses the IE specific .description property of exceptions but
|
|||
// that's nothing we can't hack our way around.
|
|||
Error.prototype.__defineGetter__('description', function () { |
|||
return this.message; |
|||
}); |
|||
|
|||
function TestHarness() { |
|||
sth.call(this, global); |
|||
this._testResults = [] |
|||
} |
|||
|
|||
// Borrow sth's registerTest method.
|
|||
TestHarness.prototype.registerTest = sth.prototype.registerTest; |
|||
|
|||
// Drop the before/after stuff, just run the test.
|
|||
TestHarness.prototype.startTesting = function () { |
|||
sth.prototype.run.call(this); |
|||
this.report(); |
|||
}; |
|||
|
|||
TestHarness.prototype.report = function () { |
|||
for (var i = 0; i < this._testResults.length; i++) { |
|||
var ut = this._testResults[i]; |
|||
// We don't fail on preconditions. Yet.
|
|||
if (ut.res == "Precondition failed") |
|||
continue; |
|||
if (ut.res != 'pass') |
|||
throw new ES5Error(ut); |
|||
} |
|||
}; |
|||
|
|||
TestHarness.prototype.startingTest = function (ut) { |
|||
this.currentTest = ut; |
|||
this._testResults.push(ut); |
|||
}; |
|||
|
|||
var ES5Harness = new TestHarness(); |
@ -1,114 +0,0 @@ |
|||
# Copyright 2008 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. |
|||
|
|||
|
|||
import test |
|||
import os |
|||
from os.path import join, exists |
|||
|
|||
|
|||
def GetSuite(name, root): |
|||
# Not implemented. |
|||
return None |
|||
|
|||
|
|||
HARNESS_FILES = ['sth.js'] |
|||
|
|||
|
|||
class ES5ConformTestCase(test.TestCase): |
|||
|
|||
def __init__(self, filename, path, context, root, mode, framework): |
|||
super(ES5ConformTestCase, self).__init__(context, path, mode) |
|||
self.filename = filename |
|||
self.framework = framework |
|||
self.root = root |
|||
|
|||
def IsNegative(self): |
|||
return self.filename.endswith('-n.js') |
|||
|
|||
def GetLabel(self): |
|||
return "%s es5conform %s" % (self.mode, self.GetName()) |
|||
|
|||
def IsFailureOutput(self, output): |
|||
if output.exit_code != 0: |
|||
return True |
|||
return 'FAILED!' in output.stdout |
|||
|
|||
def GetCommand(self): |
|||
result = self.context.GetVmCommand(self, self.mode) |
|||
result += ['-e', 'var window = this'] |
|||
result += self.framework |
|||
result.append(self.filename) |
|||
result += ['-e', 'ES5Harness.startTesting()'] |
|||
return result |
|||
|
|||
def GetName(self): |
|||
return self.path[-1] |
|||
|
|||
def GetSource(self): |
|||
return open(self.filename).read() |
|||
|
|||
|
|||
class ES5ConformTestConfiguration(test.TestConfiguration): |
|||
|
|||
def __init__(self, context, root): |
|||
super(ES5ConformTestConfiguration, self).__init__(context, root) |
|||
|
|||
def ListTests(self, current_path, path, mode, variant_flags): |
|||
tests = [] |
|||
current_root = join(self.root, 'data', 'TestCases') |
|||
harness = [] |
|||
harness += [join(self.root, 'data', 'SimpleTestHarness', f) for f in HARNESS_FILES] |
|||
harness += [join(self.root, 'harness-adapt.js')] |
|||
for root, dirs, files in os.walk(current_root): |
|||
for dotted in [x for x in dirs if x.startswith('.')]: |
|||
dirs.remove(dotted) |
|||
dirs.sort() |
|||
root_path = root[len(self.root):].split(os.path.sep) |
|||
root_path = current_path + [x for x in root_path if x] |
|||
files.sort() |
|||
for file in files: |
|||
if file.endswith('.js'): |
|||
full_path = root_path + [file[:-3]] |
|||
full_path = [x for x in full_path if not (x in ['data', 'TestCases'])] |
|||
if self.Contains(path, full_path): |
|||
test = ES5ConformTestCase(join(root, file), full_path, self.context, |
|||
self.root, mode, harness) |
|||
tests.append(test) |
|||
return tests |
|||
|
|||
def GetBuildRequirements(self): |
|||
return ['d8'] |
|||
|
|||
def GetTestStatus(self, sections, defs): |
|||
status_file = join(self.root, 'es5conform.status') |
|||
if exists(status_file): |
|||
test.ReadConfigurationInto(status_file, sections, defs) |
|||
|
|||
|
|||
def GetConfiguration(context, root): |
|||
return ES5ConformTestConfiguration(context, root) |
@ -1,6 +0,0 @@ |
|||
To run the sputniktests you must check out the test suite from |
|||
googlecode.com. The test expectations are currently relative to |
|||
version 97. To get the tests run the following command within |
|||
v8/test/sputnik/ |
|||
|
|||
svn co http://sputniktests.googlecode.com/svn/trunk/ -r97 sputniktests |
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue