| OLD | NEW |
| 1 # -*- python -*- | 1 # -*- python -*- |
| 2 # Copyright (c) 2011 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2011 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('env') | 7 Import('env') |
| 8 | 8 |
| 9 if env.Bit('linux'): | 9 if env.Bit('linux'): |
| 10 | 10 |
| 11 env.Append( | 11 env.Append( |
| 12 # TODO(cbiffle): give everyone else these warnings too. | 12 # TODO(cbiffle): give everyone else these warnings too. |
| 13 CXXFLAGS='-Weffc++ -Woverloaded-virtual -fno-rtti -fomit-frame-pointer', | 13 CXXFLAGS='-Weffc++ -Woverloaded-virtual -fno-rtti -fomit-frame-pointer', |
| 14 ) | 14 ) |
| 15 | 15 |
| 16 # NOTE: we cannot use TARGET_ROOT here because we want to share this file | 16 # NOTE: we cannot use TARGET_ROOT here because we want to share this file |
| 17 # between different scons invocations | 17 # between different scons invocations |
| 18 gen_dec=('${DESTINATION_ROOT}/gen/native_client/src/trusted/validator_arm/' | 18 gen_dec=('${DESTINATION_ROOT}/gen/native_client/src/trusted/validator_arm/' |
| 19 'decode.cc') | 19 'decode.cc') |
| 20 | 20 |
| 21 env.Command(target=gen_dec, | 21 env.Command(target=gen_dec, |
| 22 source=['armv7-opt.table', | 22 source=['armv7-opt.table', |
| 23 'armv7-thumb.table', |
| 23 'generate_decoder.py', | 24 'generate_decoder.py', |
| 24 'dgen_core.py', | 25 'dgen_core.py', |
| 25 'dgen_input.py', | 26 'dgen_input.py', |
| 26 'dgen_opt.py', | 27 'dgen_opt.py', |
| 27 'dgen_output.py'], | 28 'dgen_output.py'], |
| 28 action=['${SOURCES[1].abspath} ${SOURCES[0].abspath} ' | 29 action=['${SOURCES[2].abspath} ${SOURCES[0].abspath} ' |
| 29 '${TARGET.abspath}']) | 30 '${SOURCES[1].abspath} ${TARGET.abspath}']) |
| 30 | 31 |
| 31 env.ComponentLibrary('arm_validator_core', | 32 env.ComponentLibrary('arm_validator_core', |
| 32 ['address_set.cc', | 33 ['address_set.cc', |
| 33 'inst_classes.cc', | 34 'inst_classes.cc', |
| 34 'validator.cc', | 35 'validator.cc', |
| 35 gen_dec]) | 36 gen_dec]) |
| 36 | 37 |
| 37 env.ComponentLibrary('ncvalidate_arm_v2', | 38 env.ComponentLibrary('ncvalidate_arm_v2', |
| 38 ['ncvalidate.cc'], | 39 ['ncvalidate.cc'], |
| 39 LIBS=['arm_validator_core', | 40 LIBS=['arm_validator_core', |
| (...skipping 24 matching lines...) Expand all Loading... |
| 64 | 65 |
| 65 validator_tests = { | 66 validator_tests = { |
| 66 'test_external_jumps': 1, | 67 'test_external_jumps': 1, |
| 67 'test_forbidden_instructions': 1, | 68 'test_forbidden_instructions': 1, |
| 68 'test_internal_jumps': 1, | 69 'test_internal_jumps': 1, |
| 69 'test_sp_updates': 1, | 70 'test_sp_updates': 1, |
| 70 'test_stores': 1, | 71 'test_stores': 1, |
| 71 'test_vector_stores': 1, | 72 'test_vector_stores': 1, |
| 72 } | 73 } |
| 73 | 74 |
| 75 validator_tests_thumb = { |
| 76 'local_allowed' : 0, |
| 77 'local_disallowed' : 1, |
| 78 'test_forbidden_instructions' : 1, |
| 79 'masking_instructions' : 0, |
| 80 'mem_test' : 1, |
| 81 'branch_test' : 1, |
| 82 'bundle_test' : 1, |
| 83 'it_test' : 1, |
| 84 'test_external_jumps' : 1, |
| 85 'test_internal_jumps' : 1, |
| 86 'test_sp_updates' : 1, |
| 87 'test_stores' : 1, |
| 88 'lit_pool_test' : 0 |
| 89 } |
| 90 |
| 74 for test, exit_status in validator_tests.iteritems(): | 91 for test, exit_status in validator_tests.iteritems(): |
| 75 node = env.CommandTest( | 92 node = env.CommandTest( |
| 76 test + '_actual.out', | 93 test + '_actual.out', |
| 77 [ncval, env.File('testdata/' + test + '.nexe')], | 94 [ncval, env.File('testdata/' + test + '.nexe')], |
| 78 exit_status = str(exit_status), | 95 exit_status = str(exit_status), |
| 79 filter_regex = "'^ncval'", | 96 filter_regex = "'^ncval'", |
| 80 # NOTE: all stdout_golden are currently empty | 97 # NOTE: all stdout_golden are currently empty |
| 81 stdout_golden = env.File('testdata/' + test + '.out'), | 98 stdout_golden = env.File('testdata/' + test + '.out'), |
| 82 stderr_golden = env.File('testdata/' + test + '.err')) | 99 stderr_golden = env.File('testdata/' + test + '.err')) |
| 83 | 100 |
| 84 env.AddNodeToTestSuite(node, ['small_tests', 'validator_tests'], | 101 env.AddNodeToTestSuite(node, ['small_tests', 'validator_tests'], |
| 85 "run_arm_" + test) | 102 "run_arm_" + test) |
| 86 | 103 |
| 104 for test, exit_status in validator_tests_thumb.iteritems(): |
| 105 node = env.CommandTest( |
| 106 test + '_thumb_actual.out', |
| 107 [ncval, env.File('testdata-thumb/' + test + '.nexe')], |
| 108 exit_status = str(exit_status), |
| 109 filter_regex = "'^ncval'", |
| 110 # NOTE: all stdout_golden are currently empty |
| 111 stdout_golden = env.File('testdata-thumb/' + test + '.out'), |
| 112 stderr_golden = env.File('testdata-thumb/' + test + '.err')) |
| 113 |
| 114 env.AddNodeToTestSuite(node, ['small_tests', 'validator_tests'], |
| 115 "run_arm_" + test) |
| 116 |
| 87 gtest_env = env.Clone() | 117 gtest_env = env.Clone() |
| 88 # gtest does not compile with our stringent settings. | 118 # gtest does not compile with our stringent settings. |
| 89 gtest_env.FilterOut( | 119 gtest_env.FilterOut( |
| 90 CCFLAGS=['-pedantic'], | 120 CCFLAGS=['-pedantic'], |
| 91 CXXFLAGS=['-fno-rtti', '-Weffc++']) | 121 CXXFLAGS=['-fno-rtti', '-Weffc++']) |
| 92 gtest_env.Prepend(CPPPATH=['${SOURCE_ROOT}/testing/gtest/include']) | 122 gtest_env.Prepend(CPPPATH=['${SOURCE_ROOT}/testing/gtest/include']) |
| 93 | 123 |
| 94 # Do NOT name this program 'validator_tests' because this is the same name as | 124 # Do NOT name this program 'validator_tests' because this is the same name as |
| 95 # a test suite, and scons will run that test suite if it ever builds | 125 # a test suite, and scons will run that test suite if it ever builds |
| 96 # a program of the same name. | 126 # a program of the same name. |
| 97 validator_tests_exe = gtest_env.ComponentProgram('arm_validator_tests', | 127 validator_tests_exe = gtest_env.ComponentProgram('arm_validator_tests', |
| 98 ['validator_tests.cc'], | 128 ['validator_tests.cc'], |
| 99 EXTRA_LIBS=['gtest', 'arm_validator_core']) | 129 EXTRA_LIBS=['gtest', 'arm_validator_core']) |
| 100 | 130 |
| 101 test_node = gtest_env.CommandTest( | 131 test_node = gtest_env.CommandTest( |
| 102 'validator_tests.out', | 132 'validator_tests.out', |
| 103 command=[validator_tests_exe]) | 133 command=[validator_tests_exe]) |
| 104 gtest_env.AddNodeToTestSuite(test_node, ['small_tests'], | 134 gtest_env.AddNodeToTestSuite(test_node, ['small_tests'], |
| 105 'run_arm_validator_tests') | 135 'run_arm_validator_tests') |
| OLD | NEW |