Upstream version 5.34.104.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
4 # be 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 = env.AddBootstrap(env.GetSelLdr(), ['-v', '-f', test_prog])
19 if env.GetEmulator():
20   # Run sel_ldr through qemu-arm.  Add "-Q" to disable the platform
21   # qualification tests because they fail under qemu-arm.
22   sel_ldr_command = [env.GetEmulator()] + sel_ldr_command + ['-Q']
23
24 is_broken = not env.Bit('nacl_static_link') or env.GetSelLdr() is None
25
26 if env.Bit('build_arm') or env.Bit('build_mips32'):
27   # Use the system's 'nm' tool.  The NaCl toolchain will not be
28   # available on the ARM hardware bots, but they will be running Linux
29   # with a normal GNU toolchain available.
30   nm_tool = 'nm'
31 else:
32   # Use the NaCl toolchain's 'nm' tool since it is not available
33   # natively on Windows and Mac.
34   nm_tool = '${NM}'
35
36 node = env.CommandTest(
37     'debug_stub_test.out',
38     command=(['${PYTHON}', env.File('debug_stub_test.py'), '-v']
39              + ['--', env.get('TARGET_FULLARCH'), nm_tool] + sel_ldr_command),
40     extra_deps=[env.File('gdb_rsp.py')],
41     # Don't run the host Python through qemu-arm.
42     direct_emulation=False)
43 env.AddNodeToTestSuite(node, ['medium_tests', 'nonpexe_tests'],
44                        'run_debug_stub_test', is_broken=is_broken)
45 env.TestBindsFixedTcpPort(node)