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.
9 # This tests an interface that is specific to Mac OS X and/or Mach.
10 if not env.Bit('host_mac'):
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'):
18 if 'TRUSTED_ENV' not in env:
20 trusted_env = env['TRUSTED_ENV']
22 runner = trusted_env.ComponentProgram(
23 'mach_crash_forwarding_test', ['mach_crash_forwarding_test.c'],
26 def GetNexeByName(name):
27 return env.File('${STAGING_DIR}/%s${PROGSUFFIX}' %
28 env.ProgramNameForNmf(name))
30 # exception_test only gets built if inline assembly is allowed.
31 if not env.AllowInlineAssembly():
33 untrusted_caught_nexe = GetNexeByName('exception_test')
34 untrusted_crash_nexe = GetNexeByName('crash_test')
35 trusted_crash_nexe = GetNexeByName('crash_in_syscall')
36 is_broken = not env.Bit('nacl_static_link')
38 test_suites = ['small_tests', 'exception_tests', 'nonpexe_tests']
40 node = env.CommandTest('mach_forward_untrusted_crash_test.out',
41 [runner, 'untrusted', untrusted_crash_nexe],
42 declares_exit_status=True)
43 env.AddNodeToTestSuite(node, test_suites,
44 'run_mach_forward_untrusted_crash_test',
47 node = env.CommandTest('mach_forward_untrusted_caught_test.out',
48 [runner, 'untrusted_caught', untrusted_caught_nexe],
49 declares_exit_status=True)
50 # For Coverage instrumented tests, we ignore mach_forward_untrusted_caught_test
51 # which can produce strange result.
52 # Bug=http://code.google.com/p/nativeclient/issues/detail?id=1983
53 env.AddNodeToTestSuite(node, test_suites,
54 'run_mach_forward_untrusted_caught_test',
55 is_broken=is_broken or
56 trusted_env.Bit('coverage_enabled'))
58 node = env.CommandTest('mach_forward_trusted_crash_test.out',
59 [runner, 'trusted', trusted_crash_nexe],
60 declares_exit_status=True)
61 env.AddNodeToTestSuite(node, test_suites,
62 'run_mach_forward_trusted_crash_test',
65 node = env.CommandTest('mach_unforwarded_trusted_crash_test.out',
66 [runner, 'unforwarded_trusted', trusted_crash_nexe],
67 declares_exit_status=True)
68 env.AddNodeToTestSuite(node, test_suites,
69 'run_mach_unforwarded_trusted_crash_test',
72 node = env.CommandTest('mach_forward_early_trusted_crash_test.out',
73 [runner, 'early_trusted'], declares_exit_status=True)
74 env.AddNodeToTestSuite(node, test_suites,
75 'run_mach_forward_early_trusted_crash_test',