Chromium Code Reviews| Index: src/trusted/validator_mips/build.scons |
| diff --git a/src/trusted/validator_mips/build.scons b/src/trusted/validator_mips/build.scons |
| new file mode 100755 |
| index 0000000000000000000000000000000000000000..b5519b0d966b57f604ab164b6512f2f92f6106f4 |
| --- /dev/null |
| +++ b/src/trusted/validator_mips/build.scons |
| @@ -0,0 +1,100 @@ |
| +# -*- python -*- |
| +# Copyright (c) 2012 The Native Client Authors. All rights reserved. |
| +# Use of this source code is governed by a BSD-style license that can be |
| +# found in the LICENSE file. |
| + |
| +import os |
| +Import('env') |
| + |
| +if env.Bit('linux'): |
| + |
|
Nick Bray (chromium)
2012/04/13 20:25:26
I'd kill the empty line after the "if" - it's not
|
| + env.Append( |
| + CXXFLAGS='-Weffc++ -Woverloaded-virtual -fno-rtti -fomit-frame-pointer', |
| + ) |
| + |
| + # NOTE: we cannot use TARGET_ROOT here because we want to share this file |
| + # between different scons invocations |
| + gen_dec=('${DESTINATION_ROOT}/gen/native_client/src/trusted/validator_mips/' |
| + 'decode.cc') |
| + |
| + env.Command(target=gen_dec, |
| + source=['mips-opt.table', |
| + 'generate_decoder.py', |
| + 'dgen_core.py', |
| + 'dgen_input.py', |
| + 'dgen_opt.py', |
| + 'dgen_output.py'], |
| + action=['${SOURCES[1].abspath} ${SOURCES[0].abspath} ' |
| + '${TARGET.abspath}']) |
| + |
| + env.ComponentLibrary('mips_validator_core', |
| + ['address_set.cc', |
| + 'validator.cc', |
| + gen_dec]) |
| + |
| + env.ComponentLibrary('ncvalidate_mips', |
| + ['ncvalidate.cc'], |
| + LIBS=['mips_validator_core', |
| + '${OPTIONAL_COVERAGE_LIBS}']) |
| + |
| + ncval = env.ComponentProgram( |
| + 'mips-ncval-core', |
| + ['ncval.cc'], |
| + LIBS=['mips_validator_core', |
| + env.NaClTargetArchSuffix('ncfileutils'), |
| + '${OPTIONAL_COVERAGE_LIBS}']) |
| + |
| + |
|
Nick Bray (chromium)
2012/04/13 20:25:26
Single empty line, except between toplevel functio
|
| + env.SDKInstallBin('ncval', ncval, target='mips32') |
| + |
| + env.ComponentProgram('mips_address_set_test_binary', |
| + ['address_set_test.cc'], |
| + LIBS=['mips_validator_core', |
| + '${OPTIONAL_COVERAGE_LIBS}']) |
| + |
| + address_set_test = env.Command(target='mips_address_set_test.out', |
| + source=['address_set_test_binary'], |
| + action=['${SOURCES[0].abspath}']) |
| + |
| + # TODO(cbiffle): get this wrapped in QEMU. |
|
Nick Bray (chromium)
2012/04/13 20:25:26
TODOs list the person placing the TODO. TODO your
|
| + #env.AddNodeToTestSuite(address_set_test, ['small_tests'], 'address_set_test') |
| + |
| + validator_tests = { |
| + 'test_forbidden_instructions': 1, |
| + 'test_sp_updates': 1, |
| + 'test_stores': 1, |
| + 'test_loads': 1, |
| + 'test_jmp_reg': 1, |
| + 'test_jmp_imm': 1, |
| + 'test_read_only_regs': 1, |
| + 'test_invalid_dest': 1, |
| + } |
| + |
| + for test, exit_status in validator_tests.iteritems(): |
| + node = env.CommandTest( |
| + test + '_actual_mips.out', |
| + [ncval, env.File('testdata/' + test + '.nexe')], |
| + exit_status = str(exit_status), |
| + filter_regex = "'^ncval'", |
| + # NOTE: all stdout_golden are currently empty |
| + stdout_golden = env.File('testdata/' + test + '.out'), |
|
Nick Bray (chromium)
2012/04/13 20:25:26
I realize you're following an established pattern,
|
| + stderr_golden = env.File('testdata/' + test + '.err')) |
| + |
| + env.AddNodeToTestSuite(node, ['small_tests', 'validator_tests'], |
| + "run_mips_" + test) |
| + |
| + gtest_env = env.MakeGTestEnv() |
| + |
| + # Do NOT name this program 'validator_tests' because this is the same name as |
| + # a test suite, and scons will run that test suite if it ever builds |
| + # a program of the same name. |
| + validator_tests_exe = gtest_env.ComponentProgram('mips_validator_tests', |
| + ['validator_tests.cc'], |
| + EXTRA_LIBS=['mips_validator_core']) |
| + |
| + test_node = gtest_env.CommandTest( |
| + 'mips_validator_tests.out', |
| + command=[validator_tests_exe]) |
| + gtest_env.AddNodeToTestSuite(test_node, ['small_tests'], |
| + 'run_validator_tests') |
|
Nick Bray (chromium)
2012/04/13 20:25:26
run_mips_validator_tests?
|
| + |