Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / native_client / tests / sel_main_chrome / nacl.scons
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('env')
7
8 if 'TRUSTED_ENV' not in env:
9   Return()
10 trusted_env = env['TRUSTED_ENV']
11
12 # This test uses a nexe built by another test.  Nexes do not get
13 # staged in pexe mode, so only run this test in nonpexe mode.
14 if env.Bit('pnacl_generate_pexe'):
15   Return()
16
17 sel_main_chrome_test = trusted_env.ComponentProgram(
18     'sel_main_chrome_test', ['sel_main_chrome_test.cc'],
19     EXTRA_LIBS=['nonnacl_util', 'sel_main_chrome'])
20
21 env_vars = []
22 # The check for no-execute page protection does not work under
23 # qemu-arm (which does not implement no-execute page protection).
24 if env.Bit('target_arm') and env.UsingEmulator():
25   env_vars.append('NACL_DANGEROUS_SKIP_QUALIFICATION_TEST=1')
26
27 # This test runs the platform qualification test, which checks for DEP
28 # enforcement.  Valgrind's dynamic rewriting interferes with or
29 # disables DEP somehow, so we must disable the platform qualification
30 # tests.
31 if env.IsRunningUnderValgrind():
32   env_vars.append('NACL_DANGEROUS_SKIP_QUALIFICATION_TEST=1')
33
34 test_command_args = [env.GetIrtNexe(),
35                      env.File('${STAGING_DIR}/hello_world.nexe')]
36
37 node = env.CommandTest(
38     'sel_main_chrome_test.out',
39     env.AddBootstrap(sel_main_chrome_test, test_command_args), osenv=env_vars,
40     stdout_golden=env.File('../hello_world/hello_world.stdout'))
41 env.AddNodeToTestSuite(node, ['small_tests', 'nonpexe_tests'],
42                        'run_sel_main_chrome_test',
43                        is_broken=not env.Bit('nacl_static_link'))
44
45 # Also test with validation cache and mmap info for main nexe.
46 node = env.CommandTest(
47     'sel_main_chrome_test_vcache.out',
48     env.AddBootstrap(sel_main_chrome_test, test_command_args + ['-vcache']),
49     osenv=env_vars + ['NACLVERBOSITY=1'],
50     filter_regex='"(NaClElfFileMapSegment: EXERCISING MMAP LOAD PATH)"',
51     filter_group_only='true',
52     stderr_golden=env.File('../mmap_main_nexe/mmap_main_nexe_rpc.stderr'))
53 env.AddNodeToTestSuite(node, ['small_tests', 'nonpexe_tests'],
54                        'run_sel_main_chrome_vcache_test',
55                        is_broken=not env.Bit('nacl_static_link'))