OLD | NEW |
1 # -*- python -*- | 1 # -*- python -*- |
2 # Copyright (c) 2011 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2011 The Native Client Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 | 6 |
7 Import('env') | 7 Import('env') |
8 | 8 |
9 test_is_broken_on_this_os=False | 9 test_is_broken_on_this_os=False |
10 slop_args = [] | 10 slop_args = [] |
11 | 11 |
12 if 'TRUSTED_ENV' in env and (env['TRUSTED_ENV'].Bit('windows') or | 12 if 'TRUSTED_ENV' in env and (env['TRUSTED_ENV'].Bit('windows') or |
13 env['TRUSTED_ENV'].Bit('mac')): | 13 env['TRUSTED_ENV'].Bit('mac')): |
14 slop_args += ['-s', '10'] | 14 slop_args += ['-s', '10'] |
15 # Number of milliseconds by which a thread is allowed to wake up | 15 # Number of milliseconds by which a thread is allowed to wake up |
16 # early, after invoking nanosleep (on Windows, implemnted via | 16 # early, after invoking nanosleep (on Windows, implemnted via |
17 # Sleep()). On WinXP, Sleep sometimes return early. | 17 # Sleep()). On WinXP, Sleep sometimes return early. |
18 | 18 |
19 if 'TRUSTED_ENV' in env and env['TRUSTED_ENV'].Bit('windows'): | 19 if 'TRUSTED_ENV' in env and env['TRUSTED_ENV'].Bit('windows'): |
20 test_is_broken_on_this_os=True | 20 test_is_broken_on_this_os=True |
21 | 21 |
22 env.ComponentProgram('nanosleep_test.nexe', | 22 nexe = env.ComponentProgram('nanosleep_test', |
23 'nanosleep_test.c', | 23 'nanosleep_test.c', |
24 EXTRA_LIBS=['pthread']) | 24 EXTRA_LIBS=['pthread']) |
25 | 25 |
26 # This is a timing test, so we only run on real hardware | 26 # This is a timing test, so we only run on real hardware |
27 is_on_vm = env.Bit('running_on_vm') | 27 is_on_vm = env.Bit('running_on_vm') |
28 | 28 |
29 node = env.CommandSelLdrTestNacl( | 29 node = env.CommandSelLdrTestNacl( |
30 'nanosleep_test.out', | 30 'nanosleep_test.out', |
31 command=[env.File('nanosleep_test.nexe')] + slop_args) | 31 nexe, |
| 32 args=slop_args) |
32 env.AddNodeToTestSuite(node, ['small_tests'], 'run_nanosleep_test', | 33 env.AddNodeToTestSuite(node, ['small_tests'], 'run_nanosleep_test', |
33 is_broken=is_on_vm or test_is_broken_on_this_os) | 34 is_broken=is_on_vm or test_is_broken_on_this_os) |
OLD | NEW |