Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / native_client / tests / exception_test / 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 not env.AllowInlineAssembly() or env.Bit('nacl_clang'):
9   # This file has asm that nacl_clang doesn't support properly. See
10   # https://code.google.com/p/nativeclient/issues/detail?id=3969
11   Return()
12
13 test_args = {'sel_ldr_flags': ['-e', '-E', 'OUTSIDE_BROWSER=1'],
14              'declares_exit_status': True}
15 if env.Bit('target_arm') and env.UsingEmulator():
16   test_args['sel_ldr_flags'].extend(['-E', 'UNDER_QEMU_ARM=1'])
17
18 helper_files = []
19 if env.Bit('target_x86'):
20   helper_files.append('direction_flag_x86.S')
21 exception_test = env.ComponentProgram(
22     env.ProgramNameForNmf('exception_test'),
23     ['exception_test.c'] + helper_files,
24     EXTRA_LIBS=['${NONIRT_LIBS}', '${PTHREAD_LIBS}', '${TESTRUNNER_LIBS}',
25                 '${EXCEPTION_LIBS}', 'test_common'])
26
27 node = env.CommandSelLdrTestNacl(
28     'exception_test.out', exception_test, **test_args)
29 env.AddNodeToTestSuite(
30     node, ['small_tests', 'exception_tests'], 'run_exception_test')
31
32
33 exception_crash_test = env.ComponentProgram(
34     'exception_crash_test', ['exception_crash_test.c'],
35     EXTRA_LIBS=['${NONIRT_LIBS}', '${EXCEPTION_LIBS}'])
36
37 for subtest in ('test_bad_handler',
38                 'test_stack_outside_sandbox',
39                 'test_stack_in_rwdata',
40                 'test_stack_in_rodata',
41                 'test_stack_in_code',
42                 'test_crash_in_syscall'):
43   node = env.CommandSelLdrTestNacl(
44       'exception_%s.out' % subtest,
45       exception_crash_test, [subtest], **test_args)
46   # test_bad_handler hangs on non-whole-machine QEMU.
47   subtest_is_broken = (subtest == 'test_bad_handler' and env.UsingEmulator())
48   env.AddNodeToTestSuite(
49       node, ['small_tests', 'exception_tests'],
50       'run_exception_%s' % subtest,
51       is_broken=subtest_is_broken)
52
53
54 exceptions_disabled_test = env.ComponentProgram(
55     'exceptions_disabled_test',
56     ['exceptions_disabled_test.c'],
57     EXTRA_LIBS=['${NONIRT_LIBS}', '${EXCEPTION_LIBS}'])
58 node = env.CommandSelLdrTestNacl(
59     'exceptions_disabled_test.out',
60     exceptions_disabled_test, [],
61     declares_exit_status=True)
62 env.AddNodeToTestSuite(
63     node, ['small_tests', 'exception_tests'],
64     'run_exceptions_disabled_test')