| OLD | NEW |
| 1 # -*- python -*- | 1 # -*- python -*- |
| 2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 import os | 6 import os |
| 7 import sys | 7 import sys |
| 8 Import('env') | 8 Import('env') |
| 9 | 9 |
| 10 # vdiff is x86 only | 10 # vdiff is x86 only |
| 11 if not env.Bit('target_x86'): Return() | 11 if not env.Bit('target_x86'): Return() |
| 12 | 12 |
| 13 # ------------------------------------------------------ | 13 # ------------------------------------------------------ |
| 14 # General adjustments to the environment for builds. | 14 # General adjustments to the environment for builds. |
| 15 | 15 |
| 16 # Make a copy of debug CRT for now. | 16 # Make a copy of debug CRT for now. |
| 17 # TODO(bradnelson): Find a better way to generalize this requirement. | 17 # TODO(bradnelson): Find a better way to generalize this requirement. |
| 18 # NOTE: debug builds on windows break without this | 18 # NOTE: debug builds on windows break without this |
| 19 crt = [] | 19 crt = [] |
| 20 if env.AllBits('windows', 'debug'): | 20 if env.AllBits('windows', 'debug'): |
| 21 for i in ['.', '$STAGING_DIR']: | 21 for i in ['.', '$STAGING_DIR']: |
| 22 crt += env.Replicate(i, '$VC80_DIR/vc/redist/Debug_NonRedist/' | 22 crt += env.Replicate(i, '$VC80_DIR/vc/redist/Debug_NonRedist/' |
| 23 'x86/Microsoft.VC80.DebugCRT') | 23 'x86/Microsoft.VC80.DebugCRT') |
| 24 crt += env.Replicate(i, '$VC80_DIR/vc/redist/x86/Microsoft.VC80.CRT') | 24 crt += env.Replicate(i, '$VC80_DIR/vc/redist/x86/Microsoft.VC80.CRT') |
| 25 | 25 |
| 26 # Create environment for command-line tools and testing, rather than | 26 # Create environment for command-line tools and testing, rather than |
| 27 # part of the TCB. Then define compile-time flag that communicates | 27 # part of the TCB. Then define compile-time flag that communicates |
| 28 # that we are compiling in the test environment (rather than for the TCB). | 28 # that we are compiling in the test environment (rather than for the TCB). |
| 29 test_env = env.Clone() | 29 test_env = env.Clone() |
| 30 test_env.Append(CCFLAGS=['-DNACL_TRUSTED_BUT_NOT_TCB', '-DNACL_RAGEL_DECODER']) | 30 test_env.Append(CPPDEFINES=['NACL_TRUSTED_BUT_NOT_TCB', 'NACL_RAGEL_DECODER']) |
| 31 | 31 |
| 32 vdiff = test_env.ComponentProgram( | 32 vdiff = test_env.ComponentProgram( |
| 33 'vdiff', | 33 'vdiff', |
| 34 ['vdiff.c', 'nacl_tester.c', 'ragel_tester.c', 'str_utils.c', 'text2hex.c'], | 34 ['vdiff.c', 'nacl_tester.c', 'ragel_tester.c', 'str_utils.c', 'text2hex.c'], |
| 35 EXTRA_LIBS=[test_env.NaClTargetArchSuffix('ncdis_util'), | 35 EXTRA_LIBS=[test_env.NaClTargetArchSuffix('ncdis_util'), |
| 36 test_env.NaClTargetArchSuffix('ncvalidate'), | 36 test_env.NaClTargetArchSuffix('ncvalidate'), |
| 37 test_env.NaClTargetArchSuffix('dfa_decode'), | 37 test_env.NaClTargetArchSuffix('dfa_decode'), |
| 38 test_env.NaClTargetArchSuffix('dfa_validate'), | 38 test_env.NaClTargetArchSuffix('dfa_validate'), |
| 39 test_env.NaClTargetArchSuffix('ncval_reg_sfi'), | 39 test_env.NaClTargetArchSuffix('ncval_reg_sfi'), |
| 40 test_env.NaClTargetArchSuffix('nc_decoder'), | 40 test_env.NaClTargetArchSuffix('nc_decoder'), |
| 41 test_env.NaClTargetArchSuffix('nc_opcode_modeling_verbose'), | 41 test_env.NaClTargetArchSuffix('nc_opcode_modeling_verbose'), |
| 42 test_env.NaClTargetArchSuffix('nc_opcode_modeling'), | 42 test_env.NaClTargetArchSuffix('nc_opcode_modeling'), |
| 43 test_env.NaClTargetArchSuffix('ncdis_decode_tables'), | 43 test_env.NaClTargetArchSuffix('ncdis_decode_tables'), |
| 44 test_env.NaClTargetArchSuffix('ncval_base_verbose'), | 44 test_env.NaClTargetArchSuffix('ncval_base_verbose'), |
| 45 test_env.NaClTargetArchSuffix('ncval_base'), | 45 test_env.NaClTargetArchSuffix('ncval_base'), |
| 46 'validators', | 46 'validators', |
| 47 env.NaClTargetArchSuffix('ncvalidate'), | 47 env.NaClTargetArchSuffix('ncvalidate'), |
| 48 env.NaClTargetArchSuffix('dfa_validate_caller'), | 48 env.NaClTargetArchSuffix('dfa_validate_caller'), |
| 49 'platform', 'gio', 'utils', | 49 'platform', 'gio', 'utils', |
| 50 ]) | 50 ]) |
| 51 env.Requires(vdiff, crt) |
| 51 | 52 |
| 52 env.Requires(vdiff, crt) | 53 if env.Bit('target_x86_64'): |
| 54 node = env.CommandTest( |
| 55 'vdiff.out', command=[vdiff, '--easydiff'], |
| 56 stdout_golden=test_env.File('vdiff_x86_64_baseline.out'), |
| 57 time_warning=800, time_error=2000) |
| 58 env.AddNodeToTestSuite(node, ['validator_diff_tests'], 'vdiff_test') |
| 59 |
| 60 if env.Bit('target_x86_32'): |
| 61 # No golden output for 32-bit until more diffs are fixed |
| 62 node = env.CommandTest('vdiff.out', command=[vdiff], |
| 63 time_warning=800, time_error=2000) |
| 64 env.AddNodeToTestSuite(node, ['validator_diff_tests'], 'vdiff_test') |
| OLD | NEW |