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..cf5195ad5e98aa53096198e9da36e50093aa95e1 |
--- /dev/null |
+++ b/src/trusted/validator_mips/build.scons |
@@ -0,0 +1,94 @@ |
+# -*- 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'): |
+ 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/' |
Brad Chen
2012/05/04 22:49:50
If you look at the NaCl x86 validator you may reco
|
+ 'decode.cc') |
+ |
+ env.Command(target=gen_dec, |
+ source=['mips-opt.table', |
+ 'dgen/generate_decoder.py', |
+ 'dgen/dgen_core.py', |
+ 'dgen/dgen_input.py', |
+ 'dgen/dgen_opt.py', |
+ 'dgen/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}']) |
+ |
+ 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}']) |
+ |
+ #env.AddNodeToTestSuite(address_set_test, ['small_tests'], 'address_set_test') |
Nick Bray
2012/05/01 17:34:07
Change the test name to mips_address_set_test and
petarj
2012/05/08 14:54:19
Sure.
|
+ |
+ 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'", |
+ 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_mips_validator_tests') |