OLD | NEW |
(Empty) | |
| 1 # -*- python -*- |
| 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 |
| 4 # found in the LICENSE file. |
| 5 |
| 6 import os |
| 7 Import('env') |
| 8 |
| 9 if env.Bit('linux'): |
| 10 |
| 11 env.Append( |
| 12 CXXFLAGS='-Weffc++ -Woverloaded-virtual -fno-rtti -fomit-frame-pointer', |
| 13 ) |
| 14 |
| 15 # NOTE: we cannot use TARGET_ROOT here because we want to share this file |
| 16 # between different scons invocations |
| 17 gen_dec=('${DESTINATION_ROOT}/gen/native_client/src/trusted/validator_mips/' |
| 18 'decode.cc') |
| 19 |
| 20 env.Command(target=gen_dec, |
| 21 source=['mips-opt.table', |
| 22 'generate_decoder.py', |
| 23 'dgen_core.py', |
| 24 'dgen_input.py', |
| 25 'dgen_opt.py', |
| 26 'dgen_output.py'], |
| 27 action=['${SOURCES[1].abspath} ${SOURCES[0].abspath} ' |
| 28 '${TARGET.abspath}']) |
| 29 |
| 30 env.ComponentLibrary('mips_validator_core', |
| 31 ['address_set.cc', |
| 32 'validator.cc', |
| 33 gen_dec]) |
| 34 |
| 35 env.ComponentLibrary('ncvalidate_mips', |
| 36 ['ncvalidate.cc'], |
| 37 LIBS=['mips_validator_core', |
| 38 '${OPTIONAL_COVERAGE_LIBS}']) |
| 39 |
| 40 ncval = env.ComponentProgram( |
| 41 'mips-ncval-core', |
| 42 ['ncval.cc'], |
| 43 LIBS=['mips_validator_core', |
| 44 env.NaClTargetArchSuffix('ncfileutils'), |
| 45 '${OPTIONAL_COVERAGE_LIBS}']) |
| 46 |
| 47 |
| 48 env.SDKInstallBin('ncval', ncval, target='mips') |
| 49 |
| 50 env.ComponentProgram('mips_address_set_test_binary', |
| 51 ['address_set_test.cc'], |
| 52 LIBS=['mips_validator_core', |
| 53 '${OPTIONAL_COVERAGE_LIBS}']) |
| 54 |
| 55 address_set_test = env.Command(target='mips_address_set_test.out', |
| 56 source=['address_set_test_binary'], |
| 57 action=['${SOURCES[0].abspath}']) |
| 58 |
| 59 # TODO(cbiffle): get this wrapped in QEMU. |
| 60 #env.AddNodeToTestSuite(address_set_test, ['small_tests'], 'address_set_test') |
| 61 |
| 62 validator_tests = { |
| 63 'test_forbidden_instructions': 1, |
| 64 'test_sp_updates': 1, |
| 65 'test_stores': 1, |
| 66 'test_loads': 1, |
| 67 'test_jmp_reg': 1, |
| 68 'test_jmp_imm': 1, |
| 69 'test_read_only_regs': 1, |
| 70 'test_invalid_dest': 1, |
| 71 } |
| 72 |
| 73 for test, exit_status in validator_tests.iteritems(): |
| 74 node = env.CommandTest( |
| 75 test + '_actual_mips.out', |
| 76 [ncval, env.File('testdata/' + test + '.nexe')], |
| 77 exit_status = str(exit_status), |
| 78 filter_regex = "'^ncval'", |
| 79 # NOTE: all stdout_golden are currently empty |
| 80 stdout_golden = env.File('testdata/' + test + '.out'), |
| 81 stderr_golden = env.File('testdata/' + test + '.err')) |
| 82 |
| 83 env.AddNodeToTestSuite(node, ['small_tests', 'validator_tests'], |
| 84 "run_mips_" + test) |
| 85 |
| 86 gtest_env = env.MakeGTestEnv() |
| 87 |
| 88 # Do NOT name this program 'validator_tests' because this is the same name as |
| 89 # a test suite, and scons will run that test suite if it ever builds |
| 90 # a program of the same name. |
| 91 validator_tests_exe = gtest_env.ComponentProgram('mips_validator_tests', |
| 92 ['validator_tests.cc'], |
| 93 EXTRA_LIBS=['mips_validator_core']) |
| 94 |
| 95 test_node = gtest_env.CommandTest( |
| 96 'mips_validator_tests.out', |
| 97 command=[validator_tests_exe]) |
| 98 gtest_env.AddNodeToTestSuite(test_node, ['small_tests'], |
| 99 'run_validator_tests') |
| 100 |
OLD | NEW |