Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / native_client / tests / trusted_crash / osx_crash_forwarding / 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
9 # This tests an interface that is specific to Mac OS X and/or Mach.
10 if not env.Bit('host_mac'):
11   Return()
12
13 # These tests use nexes built by other tests. Nexes do not get staged in
14 # pexe mode, so only run this test in nonpexe mode.
15 if env.Bit('pnacl_generate_pexe'):
16   Return()
17
18 # This test uses the nexe built by exception_test, which currently doesn't
19 # build with nacl_clang. See
20 # https://code.google.com/p/nativeclient/issues/detail?id=3969
21 if env.Bit('nacl_clang'):
22   Return()
23
24 if 'TRUSTED_ENV' not in env:
25   Return()
26 trusted_env = env['TRUSTED_ENV']
27
28 runner = trusted_env.ComponentProgram(
29     'mach_crash_forwarding_test', ['mach_crash_forwarding_test.c'],
30     EXTRA_LIBS=['sel'])
31
32 def GetNexeByName(name):
33   return env.File('${STAGING_DIR}/%s${PROGSUFFIX}' %
34                   env.ProgramNameForNmf(name))
35
36 # exception_test only gets built if inline assembly is allowed.
37 if not env.AllowInlineAssembly():
38   Return()
39 untrusted_caught_nexe = GetNexeByName('exception_test')
40 untrusted_crash_nexe = GetNexeByName('crash_test')
41 trusted_crash_nexe = GetNexeByName('crash_in_syscall')
42 is_broken = not env.Bit('nacl_static_link')
43
44 test_suites = ['small_tests', 'exception_tests', 'nonpexe_tests']
45
46 node = env.CommandTest('mach_forward_untrusted_crash_test.out',
47                        [runner, 'untrusted', untrusted_crash_nexe],
48                        declares_exit_status=True)
49 env.AddNodeToTestSuite(node, test_suites,
50                        'run_mach_forward_untrusted_crash_test',
51                        is_broken=is_broken)
52
53 node = env.CommandTest('mach_forward_untrusted_caught_test.out',
54                        [runner, 'untrusted_caught', untrusted_caught_nexe],
55                        declares_exit_status=True)
56 # For Coverage instrumented tests, we ignore mach_forward_untrusted_caught_test
57 # which can produce strange result.
58 # Bug=http://code.google.com/p/nativeclient/issues/detail?id=1983
59 env.AddNodeToTestSuite(node, test_suites,
60                        'run_mach_forward_untrusted_caught_test',
61                        is_broken=is_broken or
62                                  trusted_env.Bit('coverage_enabled'))
63
64 node = env.CommandTest('mach_forward_trusted_crash_test.out',
65                        [runner, 'trusted', trusted_crash_nexe],
66                        declares_exit_status=True)
67 env.AddNodeToTestSuite(node, test_suites,
68                        'run_mach_forward_trusted_crash_test',
69                        is_broken=is_broken)
70
71 node = env.CommandTest('mach_unforwarded_trusted_crash_test.out',
72                        [runner, 'unforwarded_trusted', trusted_crash_nexe],
73                        declares_exit_status=True)
74 env.AddNodeToTestSuite(node, test_suites,
75                        'run_mach_unforwarded_trusted_crash_test',
76                        is_broken=is_broken)
77
78 node = env.CommandTest('mach_forward_early_trusted_crash_test.out',
79                        [runner, 'early_trusted'], declares_exit_status=True)
80 env.AddNodeToTestSuite(node, test_suites,
81                        'run_mach_forward_early_trusted_crash_test',
82                        is_broken=is_broken)