Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / native_client / tests / debug_stub / nacl.scons
1 # -*- python -*-
2 # Copyright 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 not env.AllowInlineAssembly():
9   Return()
10
11 if env.UnderWindowsCoverage():
12   Return()
13
14 test_prog = env.ComponentProgram(
15     'debugger_test', 'debugger_test.c',
16     EXTRA_LIBS=['${PTHREAD_LIBS}', '${NONIRT_LIBS}'])
17
18 sel_ldr_command = ['-v']
19 if env.Bit('tests_use_irt'):
20   sel_ldr_command += ['-B', env.GetIrtNexe()]
21 sel_ldr_command += ['-f', test_prog]
22 sel_ldr_command = env.AddBootstrap(env.GetSelLdr(), sel_ldr_command)
23 if env.GetEmulator():
24   # Run sel_ldr through qemu-arm.  Add "-Q" to disable the platform
25   # qualification tests because they fail under qemu-arm.
26   sel_ldr_command = [env.GetEmulator()] + sel_ldr_command + ['-Q']
27
28 is_broken = not env.Bit('nacl_static_link') or env.GetSelLdr() is None
29
30 if env.Bit('build_arm') or env.Bit('build_mips32'):
31   # Use the system's 'nm' tool.  The NaCl toolchain will not be
32   # available on the ARM hardware bots, but they will be running Linux
33   # with a normal GNU toolchain available.
34   nm_tool = 'nm'
35 else:
36   # Use the NaCl toolchain's 'nm' tool since it is not available
37   # natively on Windows and Mac.
38   nm_tool = '${NM}'
39
40 node = env.CommandTest(
41     'debug_stub_test.out',
42     command=(['${PYTHON}', env.File('debug_stub_test.py'), '-v']
43              + ['--', env.get('TARGET_FULLARCH'), nm_tool] + sel_ldr_command),
44     extra_deps=[env.File('gdb_rsp.py')],
45     # Don't run the host Python through qemu-arm.
46     direct_emulation=False,
47     size='medium')
48 env.AddNodeToTestSuite(node, ['medium_tests', 'nonpexe_tests'],
49                        'run_debug_stub_test', is_broken=is_broken)
50 env.TestBindsFixedTcpPort(node)