Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / native_client / tests / untrusted_check / nacl.scons
1 # -*- python -*-
2 # Copyright 2011 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 os
7
8 Import('env')
9
10 nexe = env.ComponentProgram('untrusted_check_test',
11                             ['untrusted_check_test.c'],
12                             EXTRA_LIBS=['platform',
13                                         'gio',
14                                         '${PTHREAD_LIBS}',
15                                         '${NONIRT_LIBS}'])
16
17 # nacl-newlib and nacl-glibc's abort() implementations produce
18 # different exit codes.
19 if env.Bit('nacl_glibc'):
20   expected_exit_status = 'untrusted_sigsegv'
21 else:
22   # abort() from libnacl exits via __builtin_trap().
23   expected_exit_status = 'untrusted_builtin_trap'
24
25 # Valgrind and ASan interfere with the exit status
26 testing_on_asan_or_valgrind = (env.Bit('running_on_valgrind') or
27                                env.Bit('asan'))
28 node = env.CommandSelLdrTestNacl(
29     'untrusted_check_test.out',
30     nexe,
31     # On Windows, PNaCl gives an absolute cygwin-style path
32     filter_regex = ('"(Fatal error in file ).*(untrusted_check_test.c)'
33                     '|(LOG_FATAL.*)'
34                     '|(Log output.*)"'),
35     filter_group_only = 'true',
36     stderr_golden = env.File('untrusted_check_test.stderr'),
37     exit_status=expected_exit_status)
38
39 env.AddNodeToTestSuite(node, ['small_tests'], 'run_untrusted_check_test',
40                        is_broken=testing_on_asan_or_valgrind)