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.
8 if not env.AllowInlineAssembly():
11 test_args = {'sel_ldr_flags': ['-e', '-E', 'OUTSIDE_BROWSER=1'],
12 'declares_exit_status': True}
13 if env.Bit('target_arm') and env.UsingEmulator():
14 test_args['sel_ldr_flags'].extend(['-E', 'UNDER_QEMU_ARM=1'])
17 if env.Bit('target_x86'):
18 helper_files.append('direction_flag_x86.S')
19 exception_test = env.ComponentProgram(
20 env.ProgramNameForNmf('exception_test'),
21 ['exception_test.c'] + helper_files,
22 EXTRA_LIBS=['${NONIRT_LIBS}', '${PTHREAD_LIBS}', '${TESTRUNNER_LIBS}',
23 '${EXCEPTION_LIBS}', 'test_common'])
25 node = env.CommandSelLdrTestNacl(
26 'exception_test.out', exception_test, **test_args)
27 env.AddNodeToTestSuite(
28 node, ['small_tests', 'exception_tests'], 'run_exception_test')
31 exception_crash_test = env.ComponentProgram(
32 'exception_crash_test', ['exception_crash_test.c'],
33 EXTRA_LIBS=['${NONIRT_LIBS}', '${EXCEPTION_LIBS}'])
35 for subtest in ('test_bad_handler',
36 'test_stack_outside_sandbox',
37 'test_stack_in_rwdata',
38 'test_stack_in_rodata',
40 'test_crash_in_syscall'):
41 node = env.CommandSelLdrTestNacl(
42 'exception_%s.out' % subtest,
43 exception_crash_test, [subtest], **test_args)
44 # test_bad_handler hangs on non-whole-machine QEMU.
45 subtest_is_broken = (subtest == 'test_bad_handler' and env.UsingEmulator())
46 env.AddNodeToTestSuite(
47 node, ['small_tests', 'exception_tests'],
48 'run_exception_%s' % subtest,
49 is_broken=subtest_is_broken)
52 exceptions_disabled_test = env.ComponentProgram(
53 'exceptions_disabled_test',
54 ['exceptions_disabled_test.c'],
55 EXTRA_LIBS=['${NONIRT_LIBS}', '${EXCEPTION_LIBS}'])
56 node = env.CommandSelLdrTestNacl(
57 'exceptions_disabled_test.out',
58 exceptions_disabled_test, [],
59 declares_exit_status=True)
60 env.AddNodeToTestSuite(
61 node, ['small_tests', 'exception_tests'],
62 'run_exceptions_disabled_test')