c082a8b77484cc1ba0991abfe81e421ece7a2b61
[platform/framework/web/crosswalk.git] / src / native_client / src / trusted / validator / nacl.scons
1 # -*- python -*-
2 # Copyright 2011 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('env')
7
8 if 'TRUSTED_ENV' not in env:
9   Return()
10
11 # This environment variable tells the test how to invoke nacl-gcc.  It
12 # is slightly hacky, but seems easier than trying to describe the test
13 # fixture creation in Scons.
14 if env.Bit('build_x86_32'):
15   env_vars = 'NACL_CFLAGS=-m32'
16 elif env.Bit('build_x86_64'):
17   env_vars = 'NACL_CFLAGS=-m64'
18 else:
19   Return()
20
21 env.PrependENVPath('PATH', env['TRUSTED_ENV'].SubstList2('${STAGING_DIR}'))
22 dependencies = [
23     env['TRUSTED_ENV'].File('${STAGING_DIR}/ncval_new${PROGSUFFIX}'),]
24
25 node = env.CommandTest(
26     'ncval_annotate_test.out',
27     command=['${PYTHON}', env.File('ncval_annotate_test.py'), '-v'],
28     extra_deps=dependencies,
29     osenv=env_vars)
30 env.AddNodeToTestSuite(node, ['small_tests'], 'run_ncval_annotate_test',
31                        # PNaCl does not allow the inline assembly that
32                        # we use to test this.
33                        # The test also hardcodes use of nacl-gcc and doesn't
34                        # really need to run more than once anyway.
35                        is_broken=env.Bit('bitcode') or env.Bit('nacl_clang'))