| 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 | 6 |
| 7 import os | 7 import os |
| 8 import sys | 8 import sys |
| 9 Import('env') | 9 Import('env') |
| 10 | 10 |
| 11 | 11 |
| 12 env.ComponentLibrary(env.NaClTargetArchSuffix('ncfileutils'), ['ncfileutil.c']) | 12 env.ComponentLibrary(env.NaClTargetArchSuffix('ncfileutils'), ['ncfileutil.c']) |
| 13 | 13 |
| 14 val_lib_env = env.Clone() | 14 val_lib_env = env.Clone() |
| 15 if env.Bit('validator_ragel'): | 15 if env.Bit('validator_ragel'): |
| 16 val_lib_env.Append(CPPDEFINES=[['NACL_VALIDATOR_RAGEL', '1']]) | 16 val_lib_env.Append(CPPDEFINES=[['NACL_VALIDATOR_RAGEL', '1']]) |
| 17 | 17 |
| 18 val_lib_env.ComponentLibrary('validation_cache', ['validation_cache.c']) |
| 19 |
| 18 val_lib_env.ComponentLibrary('validators', ['validator_init.c']) | 20 val_lib_env.ComponentLibrary('validators', ['validator_init.c']) |
| 19 | 21 |
| 20 if env.Bit('target_x86') and not env.Bit('validator_ragel'): | 22 if env.Bit('target_x86') and not env.Bit('validator_ragel'): |
| 21 # The R-DFA validator ignores requests to cache validation results, so the | 23 # The R-DFA validator ignores requests to cache validation results, so the |
| 22 # test fails. Validation caching will probably never be supported in R-DFA | 24 # test fails. Validation caching will probably never be supported in R-DFA |
| 23 # because the R-DFA pass is faster than computing a hash for the executable | 25 # because the R-DFA pass is faster than computing a hash for the executable |
| 24 # segment. | 26 # segment. |
| 25 # | 27 # |
| 26 # TODO(ncbray) support ARM. This will require making validation caching safe | 28 # TODO(ncbray) support ARM. This will require making validation caching safe |
| 27 # for ARM and embedding ARM binary chunks in the test that can trigger various | 29 # for ARM and embedding ARM binary chunks in the test that can trigger various |
| 28 # validation scenarios. | 30 # validation scenarios. |
| 29 gtest_env = env.MakeGTestEnv() | 31 gtest_env = env.MakeGTestEnv() |
| 30 | 32 |
| 31 validation_cache_test_exe = gtest_env.ComponentProgram( | 33 validation_cache_test_exe = gtest_env.ComponentProgram( |
| 32 'validation_cache_test', | 34 'validation_cache_test', |
| 33 ['validation_cache_test.cc'], | 35 ['validation_cache_test.cc'], |
| 34 EXTRA_LIBS=['validators']) | 36 EXTRA_LIBS=['validators']) |
| 35 | 37 |
| 36 node = gtest_env.CommandTest( | 38 node = gtest_env.CommandTest( |
| 37 'validation_cache_test.out', | 39 'validation_cache_test.out', |
| 38 command=[validation_cache_test_exe]) | 40 command=[validation_cache_test_exe]) |
| 39 | 41 |
| 40 env.AddNodeToTestSuite(node, ['small_tests', 'validator_tests'], | 42 env.AddNodeToTestSuite(node, ['small_tests', 'validator_tests'], |
| 41 'run_validation_cache_test') | 43 'run_validation_cache_test') |
| OLD | NEW |