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     'test-accessors.cc',
     38     'test-alloc.cc',
     39     'test-api.cc',
     40     'test-ast.cc',
     41     'test-compiler.cc',
     42     'test-conversions.cc',
     43     'test-debug.cc',
     44     'test-decls.cc',
     45     'test-flags.cc',
     46     'test-func-name-inference.cc',
     47     'test-hashmap.cc',
     48     'test-heap.cc',
     49     'test-heap-profiler.cc',
     50     'test-list.cc',
     51     'test-lock.cc',
     52     'test-log.cc',
     53     'test-log-utils.cc',
     54     'test-mark-compact.cc',
     55     'test-parsing.cc',
     56     'test-regexp.cc',
     57     'test-serialize.cc',
     58     'test-sockets.cc',
     59     'test-spaces.cc',
     60     'test-strings.cc',
     61     'test-threads.cc',
     62     'test-thread-termination.cc',
     63     'test-utils.cc',
     64     'test-version.cc'
     65   ],
     66   'arch:arm':  [
     67     'test-assembler-arm.cc',
     68     'test-disasm-arm.cc'
     69   ],
     70   'arch:ia32': [
     71     'test-assembler-ia32.cc',
     72     'test-disasm-ia32.cc',
     73     'test-log-stack-tracer.cc'
     74   ],
     75   'arch:x64': ['test-assembler-x64.cc',
     76                'test-macro-assembler-x64.cc',
     77                'test-log-stack-tracer.cc'],
     78   'arch:mips': ['test-assembler-mips.cc'],
     79   'os:linux':  ['test-platform-linux.cc'],
     80   'os:macos':  ['test-platform-macos.cc'],
     81   'os:nullos': ['test-platform-nullos.cc'],
     82   'os:win32':  ['test-platform-win32.cc']
     83 }
     84 
     85 
     86 def Build():
     87   cctest_files = context.GetRelevantSources(SOURCES)
     88   env = Environment()
     89   env.Replace(**context.flags['cctest'])
     90   context.ApplyEnvOverrides(env)
     91   # There seems to be a glitch in the way scons decides where to put
     92   # PDB files when compiling using MSVC so we specify it manually.
     93   # This should not affect any other platforms.
     94   return env.Program('cctest', ['cctest.cc', cctest_files, object_files],
     95       PDB='cctest.exe.pdb')
     96 
     97 
     98 program = Build()
     99 Return('program')
    100