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 slop_args = [] | 10 slop_args = [] |
10 | 11 |
11 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 |
12 env['TRUSTED_ENV'].Bit('mac')): | 13 env['TRUSTED_ENV'].Bit('mac')): |
13 slop_args += ['-s', '10'] | 14 slop_args += ['-s', '10'] |
14 # 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 |
15 # early, after invoking nanosleep (on Windows, implemnted via | 16 # early, after invoking nanosleep (on Windows, implemnted via |
16 # Sleep()). On WinXP, Sleep sometimes return early. | 17 # Sleep()). On WinXP, Sleep sometimes return early. |
17 | 18 |
19 if 'TRUSTED_ENV' in env and env['TRUSTED_ENV'].Bit('windows'): | |
20 test_is_broken_on_this_os=True | |
21 | |
18 env.ComponentProgram('nanosleep_test.nexe', | 22 env.ComponentProgram('nanosleep_test.nexe', |
19 'nanosleep_test.c', | 23 'nanosleep_test.c', |
20 EXTRA_LIBS=['pthread']) | 24 EXTRA_LIBS=['pthread']) |
21 | 25 |
22 # 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 |
23 is_broken = env.Bit('running_on_vm') | 27 is_broken = env.Bit('running_on_vm') |
24 | 28 |
25 node = env.CommandSelLdrTestNacl( | 29 node = env.CommandSelLdrTestNacl( |
26 'nanosleep_test.out', | 30 'nanosleep_test.out', |
27 command=[env.File('nanosleep_test.nexe')] + slop_args) | 31 command=[env.File('nanosleep_test.nexe')] + slop_args) |
28 env.AddNodeToTestSuite(node, ['small_tests'], 'run_nanosleep_test', | 32 env.AddNodeToTestSuite(node, ['small_tests'], 'run_nanosleep_test', |
29 is_broken=is_broken) | 33 is_broken=is_broken or test_is_broken_on_this_os) |
jasonwkim
2011/06/01 17:38:32
What about is_on_vm?
bsy
2011/06/01 18:21:16
renamed here and on line 27.
| |
OLD | NEW |