Home | History | Annotate | Download | only in cctest
      1 # Copyright 2008 the V8 project authors. All rights reserved.
      2 # Redistribution and use in source and binary forms, with or without
      3 # modification, are permitted provided that the following conditions are
      4 # met:
      5 #
      6 #     * Redistributions of source code must retain the above copyright
      7 #       notice, this list of conditions and the following disclaimer.
      8 #     * Redistributions in binary form must reproduce the above
      9 #       copyright notice, this list of conditions and the following
     10 #       disclaimer in the documentation and/or other materials provided
     11 #       with the distribution.
     12 #     * Neither the name of Google Inc. nor the names of its
     13 #       contributors may be used to endorse or promote products derived
     14 #       from this software without specific prior written permission.
     15 #
     16 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     17 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     18 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
     19 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
     20 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
     21 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
     22 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     23 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     24 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     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.
     27 
     28 import sys
     29 from os.path import join, dirname, abspath
     30 root_dir = dirname(File('SConstruct').rfile().abspath)
     31 sys.path.append(join(root_dir, 'tools'))
     32 Import('context object_files')
     33 
     34 
     35 SOURCES = {
     36   'all': [
     37     'gay-fixed.cc',
     38     'gay-precision.cc',
     39     'gay-shortest.cc',
     40     'test-accessors.cc',
     41     'test-alloc.cc',
     42     'test-api.cc',
     43     'test-ast.cc',
     44     'test-bignum-dtoa.cc',
     45     'test-bignum.cc',
     46     'test-circular-queue.cc',
     47     'test-compiler.cc',
     48     'test-conversions.cc',
     49     'test-cpu-profiler.cc',
     50     'test-dataflow.cc',
     51     'test-debug.cc',
     52     'test-decls.cc',
     53     'test-deoptimization.cc',
     54     'test-diy-fp.cc',
     55     'test-double.cc',
     56     'test-dtoa.cc',
     57     'test-fast-dtoa.cc',
     58     'test-fixed-dtoa.cc',
     59     'test-flags.cc',
     60     'test-func-name-inference.cc',
     61     'test-hashmap.cc',
     62     'test-heap-profiler.cc',
     63     'test-heap.cc',
     64     'test-list.cc',
     65     'test-liveedit.cc',
     66     'test-lock.cc',
     67     'test-log-utils.cc',
     68     'test-log.cc',
     69     'test-mark-compact.cc',
     70     'test-parsing.cc',
     71     'test-platform-tls.cc',
     72     'test-profile-generator.cc',
     73     'test-regexp.cc',
     74     'test-reloc-info.cc',
     75     'test-serialize.cc',
     76     'test-sockets.cc',
     77     'test-spaces.cc',
     78     'test-strings.cc',
     79     'test-strtod.cc',
     80     'test-thread-termination.cc',
     81     'test-threads.cc',
     82     'test-type-info.cc',
     83     'test-unbound-queue.cc',
     84     'test-utils.cc',
     85     'test-version.cc'
     86   ],
     87   'arch:arm':  [
     88     'test-assembler-arm.cc',
     89     'test-disasm-arm.cc'
     90   ],
     91   'arch:ia32': [
     92     'test-assembler-ia32.cc',
     93     'test-disasm-ia32.cc',
     94     'test-log-stack-tracer.cc'
     95   ],
     96   'arch:x64': ['test-assembler-x64.cc',
     97                'test-macro-assembler-x64.cc',
     98                'test-log-stack-tracer.cc'],
     99   'arch:mips': ['test-assembler-mips.cc'],
    100   'os:linux':  ['test-platform-linux.cc'],
    101   'os:macos':  ['test-platform-macos.cc'],
    102   'os:nullos': ['test-platform-nullos.cc'],
    103   'os:win32':  ['test-platform-win32.cc']
    104 }
    105 
    106 
    107 def Build():
    108   cctest_files = context.GetRelevantSources(SOURCES)
    109   env = Environment()
    110   env.Replace(**context.flags['cctest'])
    111   context.ApplyEnvOverrides(env)
    112   # 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.
    114   # This should not affect any other platforms.
    115   return env.Program('cctest', ['cctest.cc', cctest_files, object_files],
    116       PDB='cctest.exe.pdb')
    117 
    118 
    119 program = Build()
    120 Return('program')
    121