Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / native_client / tests / futexes / 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 valgrind = env.ComponentObject(
9     'valgrind_annotations.o',
10     '${MAIN_DIR}/src/untrusted/valgrind/dynamic_annotations.c')
11
12 # These tests are flaky on mac10.7-newlib-dbg-asan.
13 # See https://code.google.com/p/nativeclient/issues/detail?id=3906
14 is_broken = env.Bit('asan') and env.Bit('host_mac')
15
16 # TEST_IRT_FUTEX=0 works with nacl-glibc (since it has its own futex
17 # implementation) and with libpthread_private, but not with
18 # nacl-newlib's IRT-using libpthread.
19 if env.Bit('nacl_glibc') or not env.Bit('tests_use_irt'):
20   test_env = env.Clone()
21   test_env.Append(CPPDEFINES=[['TEST_IRT_FUTEX', '0'],
22                               ['TEST_FUTEX_SYSCALLS', '0']])
23   nexe = test_env.ComponentProgram(
24       'futex_test', ['futex_test.c'] + valgrind,
25       EXTRA_LIBS=['${NONIRT_LIBS}', '${PTHREAD_LIBS}'])
26
27   node = env.CommandSelLdrTestNacl('futex_test.out', nexe)
28   env.AddNodeToTestSuite(node, ['small_tests'], 'run_futex_test',
29                          is_broken=is_broken)
30
31
32 if env.Bit('tests_use_irt'):
33   test_env = env.Clone()
34   test_env.Append(CPPDEFINES=[['TEST_IRT_FUTEX', '1'],
35                               ['TEST_FUTEX_SYSCALLS', '0']])
36   nexe = test_env.ComponentProgram(
37       'irt_futex_test',
38       [test_env.ComponentObject('irt_futex_test.o', 'futex_test.c')] + valgrind,
39       EXTRA_LIBS=['${NONIRT_LIBS}', '${PTHREAD_LIBS}'])
40
41   node = env.CommandSelLdrTestNacl('irt_futex_test.out', nexe)
42   env.AddNodeToTestSuite(node, ['small_tests'], 'run_irt_futex_test',
43                          is_broken=is_broken)
44
45
46 test_env = env.Clone()
47 test_env.Append(CPPDEFINES=[['TEST_IRT_FUTEX', '0'],
48                             ['TEST_FUTEX_SYSCALLS', '1']])
49 nexe = test_env.ComponentProgram(
50     'futex_syscalls_test',
51     [test_env.ComponentObject('futex_syscalls_test.o', 'futex_test.c')]
52     + valgrind,
53     EXTRA_LIBS=['${NONIRT_LIBS}', '${PTHREAD_LIBS}'])
54
55 node = env.CommandSelLdrTestNacl('futex_syscalls_test.out', nexe)
56 env.AddNodeToTestSuite(node, ['small_tests'], 'run_futex_syscalls_test',
57                        is_broken=is_broken)