Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2008 the V8 project authors. All rights reserved. | 1 # Copyright 2008 the V8 project authors. All rights reserved. |
| 2 # Redistribution and use in source and binary forms, with or without | 2 # Redistribution and use in source and binary forms, with or without |
| 3 # modification, are permitted provided that the following conditions are | 3 # modification, are permitted provided that the following conditions are |
| 4 # met: | 4 # met: |
| 5 # | 5 # |
| 6 # * Redistributions of source code must retain the above copyright | 6 # * Redistributions of source code must retain the above copyright |
| 7 # notice, this list of conditions and the following disclaimer. | 7 # notice, this list of conditions and the following disclaimer. |
| 8 # * Redistributions in binary form must reproduce the above | 8 # * Redistributions in binary form must reproduce the above |
| 9 # copyright notice, this list of conditions and the following | 9 # copyright notice, this list of conditions and the following |
| 10 # disclaimer in the documentation and/or other materials provided | 10 # disclaimer in the documentation and/or other materials provided |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 22 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 22 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 23 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 24 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 26 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | 27 |
| 28 import sys | 28 import sys |
| 29 from os.path import join, dirname, abspath | 29 from os.path import join, dirname, abspath |
| 30 root_dir = dirname(File('SConstruct').rfile().abspath) | 30 root_dir = dirname(File('SConstruct').rfile().abspath) |
| 31 sys.path.append(join(root_dir, 'tools')) | 31 sys.path.append(join(root_dir, 'tools')) |
| 32 import js2c | |
| 32 Import('context object_files tools') | 33 Import('context object_files tools') |
| 33 | 34 |
| 34 | 35 |
| 36 # Needed for test-log. Paths are relative to the cctest dir. | |
| 37 JS_FILES_FOR_TESTS = ''' | |
|
Sven Panne
2011/07/14 08:06:42
Tiny style issue: JS_FILES_FOR_TESTS = [ 'blah', '
mnaganov (inactive)
2011/07/14 11:36:26
Fixed!
| |
| 38 ../../../tools/splaytree.js | |
| 39 ../../../tools/codemap.js | |
| 40 ../../../tools/csvparser.js | |
| 41 ../../../tools/consarray.js | |
| 42 ../../../tools/profile.js | |
| 43 ../../../tools/profile_view.js | |
| 44 ../../../tools/logreader.js | |
| 45 log-eq-of-logging-and-traversal.js | |
| 46 '''.split() | |
| 47 | |
| 48 | |
| 35 SOURCES = { | 49 SOURCES = { |
| 36 'all': [ | 50 'all': [ |
| 37 'gay-fixed.cc', | 51 'gay-fixed.cc', |
| 38 'gay-precision.cc', | 52 'gay-precision.cc', |
| 39 'gay-shortest.cc', | 53 'gay-shortest.cc', |
| 40 'test-accessors.cc', | 54 'test-accessors.cc', |
| 41 'test-alloc.cc', | 55 'test-alloc.cc', |
| 42 'test-api.cc', | 56 'test-api.cc', |
| 43 'test-ast.cc', | 57 'test-ast.cc', |
| 44 'test-bignum-dtoa.cc', | 58 'test-bignum-dtoa.cc', |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 102 'os:nullos': ['test-platform-nullos.cc'], | 116 'os:nullos': ['test-platform-nullos.cc'], |
| 103 'os:win32': ['test-platform-win32.cc'] | 117 'os:win32': ['test-platform-win32.cc'] |
| 104 } | 118 } |
| 105 | 119 |
| 106 | 120 |
| 107 def Build(): | 121 def Build(): |
| 108 cctest_files = context.GetRelevantSources(SOURCES) | 122 cctest_files = context.GetRelevantSources(SOURCES) |
| 109 env = Environment(tools=tools) | 123 env = Environment(tools=tools) |
| 110 env.Replace(**context.flags['cctest']) | 124 env.Replace(**context.flags['cctest']) |
| 111 context.ApplyEnvOverrides(env) | 125 context.ApplyEnvOverrides(env) |
| 126 env['BUILDERS']['JS2C'] = Builder(action=js2c.JS2C) | |
| 127 | |
| 128 # Combine the JavaScript library files into a single C++ file and | |
| 129 # compile it. | |
| 130 js_files = [s for s in JS_FILES_FOR_TESTS] | |
| 131 js_files_src = env.JS2C( | |
| 132 ['js-files-for-cctest.cc'], js_files, **{'TYPE': 'TEST', 'COMPRESSION': 'off '}) | |
| 133 js_files_obj = context.ConfigureObject(env, js_files_src, CPPPATH=['.']) | |
| 134 | |
| 112 # There seems to be a glitch in the way scons decides where to put | 135 # There seems to be a glitch in the way scons decides where to put |
| 113 # PDB files when compiling using MSVC so we specify it manually. | 136 # PDB files when compiling using MSVC so we specify it manually. |
| 114 # This should not affect any other platforms. | 137 # This should not affect any other platforms. |
| 138 object_files.append(js_files_obj) | |
| 115 return env.Program('cctest', ['cctest.cc', cctest_files, object_files], | 139 return env.Program('cctest', ['cctest.cc', cctest_files, object_files], |
| 116 PDB='cctest.exe.pdb') | 140 PDB='cctest.exe.pdb') |
| 117 | 141 |
| 118 | 142 |
| 119 program = Build() | 143 program = Build() |
| 120 Return('program') | 144 Return('program') |
| OLD | NEW |