| OLD | NEW |
| 1 # -*- python -*- | 1 # -*- python -*- |
| 2 # Copyright 2008 The Native Client Authors. All rights reserved. | 2 # Copyright 2008 The Native Client Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can | 3 # Use of this source code is governed by a BSD-style license that can |
| 4 # be found in the LICENSE file. | 4 # be found in the LICENSE file. |
| 5 | 5 |
| 6 | 6 |
| 7 Import('env') | 7 Import('env') |
| 8 | 8 |
| 9 # NOTE: the arm emulator does not handle atomic ops properly | 9 # NOTE: the arm emulator does not handle atomic ops properly |
| 10 # NOTE: the default setting of 10k rounds is too slow on ARM | 10 # NOTE: the default setting of 10k rounds is too slow on ARM |
| 11 EXTRA_ARGS = ['100'] | 11 EXTRA_ARGS = ['100'] |
| 12 | 12 |
| 13 # TODO(robertm): research why the bitcode clause is necessary | 13 # TODO(robertm): research why the bitcode clause is necessary |
| 14 # NOTE(jasonwkim): [2010/08/31 13:49:46 PDT (Tuesday)] | 14 # NOTE(jasonwkim): [2010/08/31 13:49:46 PDT (Tuesday)] |
| 15 # small_thread_test has problem with arm/qemu (also fails on x86-32-pnacl) | 15 # small_thread_test has problem with arm/qemu (also fails on x86-32-pnacl) |
| 16 is_broken = env.Bit('target_arm') and env.UsingEmulator() | 16 is_broken = env.Bit('target_arm') and env.UsingEmulator() |
| 17 | 17 |
| 18 if env.IsRunningUnderValgrind(): | 18 if env.IsRunningUnderValgrind(): |
| 19 EXTRA_ARGS = ['20'] | 19 EXTRA_ARGS = ['20'] |
| 20 | 20 |
| 21 ANNOTATIONS_LIBS=[] | 21 ANNOTATIONS_LIBS=[] |
| 22 if env.Bit('nacl_glibc'): | 22 if env.Bit('nacl_glibc'): |
| 23 ANNOTATIONS_LIBS += ['dynamic_annotations'] | 23 ANNOTATIONS_LIBS += ['dynamic_annotations'] |
| 24 | 24 |
| 25 env.ComponentProgram('thread_test.nexe', | 25 thread_test_nexe = env.ComponentProgram( |
| 26 'thread_test.c', | 26 'thread_test', |
| 27 EXTRA_LIBS=['pthread'] + ANNOTATIONS_LIBS, | 27 'thread_test.c', |
| 28 ) | 28 EXTRA_LIBS=['pthread'] + ANNOTATIONS_LIBS) |
| 29 |
| 29 node = env.CommandSelLdrTestNacl( | 30 node = env.CommandSelLdrTestNacl( |
| 30 'thread_test.out', | 31 'thread_test.out', |
| 31 command=[env.File('thread_test.nexe')] + EXTRA_ARGS, | 32 thread_test_nexe, |
| 33 args=EXTRA_ARGS, |
| 32 # TODO: investigate why this is slow on old linux system | 34 # TODO: investigate why this is slow on old linux system |
| 33 size='large', | 35 size='large', |
| 34 ) | 36 ) |
| 35 # NOTE: this should be a pretty slow test, but its been sped up | 37 # NOTE: this should be a pretty slow test, but its been sped up |
| 36 # to not tickle bug 853 | 38 # to not tickle bug 853 |
| 37 env.AddNodeToTestSuite(node, ['small_tests'], 'run_thread_test', | 39 env.AddNodeToTestSuite(node, ['small_tests'], 'run_thread_test', |
| 38 is_broken=is_broken or | 40 is_broken=is_broken or |
| 39 # TODO(khim): reenable it when cause of failure on 32bit Windows glibc | 41 # TODO(khim): reenable it when cause of failure on 32bit Windows glibc |
| 40 # will be found. | 42 # will be found. |
| 41 # See: http://code.google.com/p/nativeclient/issues/detail?id=1690 | 43 # See: http://code.google.com/p/nativeclient/issues/detail?id=1690 |
| 42 ('TRUSTED_ENV' in env and | 44 ('TRUSTED_ENV' in env and |
| 43 env['TRUSTED_ENV'].Bit('windows') and | 45 env['TRUSTED_ENV'].Bit('windows') and |
| 44 env.Bit('build_x86_32') and | 46 env.Bit('build_x86_32') and |
| 45 env.Bit('nacl_glibc'))) | 47 env.Bit('nacl_glibc'))) |
| 46 | 48 |
| 47 | 49 |
| 48 env.ComponentProgram('simple_thread_test.nexe', | 50 simple_thread_test_nexe = env.ComponentProgram( |
| 49 'simple_thread_test.c', | 51 'simple_thread_test', |
| 50 EXTRA_LIBS=['pthread'], | 52 'simple_thread_test.c', |
| 51 ) | 53 EXTRA_LIBS=['pthread']) |
| 54 |
| 52 node = env.CommandSelLdrTestNacl( | 55 node = env.CommandSelLdrTestNacl( |
| 53 'simple_thread_test.out', | 56 'simple_thread_test.out', |
| 54 command=[env.File('simple_thread_test.nexe')], | 57 simple_thread_test_nexe, |
| 55 size='small', | 58 size='small', |
| 56 ) | 59 ) |
| 57 env.AddNodeToTestSuite(node, ['small_tests'], 'run_simple_thread_test', | 60 env.AddNodeToTestSuite(node, ['small_tests'], 'run_simple_thread_test', |
| 58 is_broken=is_broken) | 61 is_broken=is_broken) |
| 59 | 62 |
| 60 env.ComponentProgram('race_test.nexe', | 63 race_test_nexe = env.ComponentProgram( |
| 61 'race_test.c', | 64 'race_test', |
| 62 EXTRA_LIBS=['pthread'] + ANNOTATIONS_LIBS, | 65 'race_test.c', |
| 63 ) | 66 EXTRA_LIBS=['pthread'] + ANNOTATIONS_LIBS) |
| 67 |
| 64 node = env.CommandSelLdrTestNacl( | 68 node = env.CommandSelLdrTestNacl( |
| 65 'race_test.out', | 69 'race_test.out', |
| 66 command=[env.File('race_test.nexe')], | 70 race_test_nexe, |
| 67 size='small', | 71 size='small', |
| 68 ) | 72 ) |
| 69 env.AddNodeToTestSuite(node, ['small_tests', 'tsan_bot_tests'], 'run_race_test', | 73 env.AddNodeToTestSuite(node, ['small_tests', 'tsan_bot_tests'], 'run_race_test', |
| 70 is_broken=is_broken) | 74 is_broken=is_broken) |
| 71 | 75 |
| 72 env.ComponentProgram('main_thread_pthread_exit_test.nexe', | 76 main_thread_pthread_exit_test_nexe = env.ComponentProgram( |
| 73 'main_thread_pthread_exit_test.c', | 77 'main_thread_pthread_exit_test', |
| 74 EXTRA_LIBS=['pthread'], | 78 'main_thread_pthread_exit_test.c', |
| 75 ) | 79 EXTRA_LIBS=['pthread'], |
| 80 ) |
| 76 | 81 |
| 77 env.ComponentProgram('main_thread_pthread_exit_test2.nexe', | 82 main_thread_pthread_exit_test2_nexe = env.ComponentProgram( |
| 78 'main_thread_pthread_exit_test2.c', | 83 'main_thread_pthread_exit_test2', |
| 79 EXTRA_LIBS=['pthread'], | 84 'main_thread_pthread_exit_test2.c', |
| 80 ) | 85 EXTRA_LIBS=['pthread'], |
| 86 ) |
| 81 | 87 |
| 82 node = env.CommandSelLdrTestNacl( | 88 node = env.CommandSelLdrTestNacl( |
| 83 'main_thread_pthread_exit_test.out', | 89 'main_thread_pthread_exit_test.out', |
| 84 command=[env.File('main_thread_pthread_exit_test.nexe')], | 90 main_thread_pthread_exit_test_nexe, |
| 85 size='small', | 91 size='small', |
| 86 ) | 92 ) |
| 87 | 93 |
| 88 node2 = env.CommandSelLdrTestNacl( | 94 node2 = env.CommandSelLdrTestNacl( |
| 89 'main_thread_pthread_exit_test2.out', | 95 'main_thread_pthread_exit_test2.out', |
| 90 command=[env.File('main_thread_pthread_exit_test2.nexe')], | 96 main_thread_pthread_exit_test2_nexe, |
| 91 size='small', | 97 size='small', |
| 92 ) | 98 ) |
| 93 | 99 |
| 94 # This test fails with nacl-glibc when statically linked. | 100 # This test fails with nacl-glibc when statically linked. |
| 95 # This is a bug in upstream glibc: | 101 # This is a bug in upstream glibc: |
| 96 # see http://sourceware.org/bugzilla/show_bug.cgi?id=12310 | 102 # see http://sourceware.org/bugzilla/show_bug.cgi?id=12310 |
| 97 if not (env.Bit('nacl_glibc') and env.Bit('nacl_static_link')): | 103 if not (env.Bit('nacl_glibc') and env.Bit('nacl_static_link')): |
| 98 env.AddNodeToTestSuite(node, ['small_tests'], | 104 env.AddNodeToTestSuite(node, ['small_tests'], |
| 99 'run_main_thread_pthread_exit_test', | 105 'run_main_thread_pthread_exit_test', |
| 100 is_broken=is_broken) | 106 is_broken=is_broken) |
| 101 # This test additionally doesn't work with newlib. | 107 # This test additionally doesn't work with newlib. |
| 102 env.AddNodeToTestSuite(node2, ['small_tests'], | 108 env.AddNodeToTestSuite(node2, ['small_tests'], |
| 103 'run_main_thread_pthread_exit_test2', | 109 'run_main_thread_pthread_exit_test2', |
| 104 is_broken=is_broken or not env.Bit('nacl_glibc')) | 110 is_broken=is_broken or not env.Bit('nacl_glibc')) |
| 105 | 111 |
| 106 env.ComponentProgram('cond_wait_test.nexe', | 112 cond_wait_test_nexe = env.ComponentProgram( |
| 107 'cond_wait_test.cc', | 113 'cond_wait_test', |
| 108 EXTRA_LIBS=['pthread'], | 114 'cond_wait_test.cc', |
| 109 ) | 115 EXTRA_LIBS=['pthread']) |
| 116 |
| 110 node = env.CommandSelLdrTestNacl( | 117 node = env.CommandSelLdrTestNacl( |
| 111 'cond_wait_test.out', | 118 'cond_wait_test.out', |
| 112 command=[env.File('cond_wait_test.nexe')], | 119 cond_wait_test_nexe, |
| 113 size='small', | 120 size='small', |
| 114 ) | 121 ) |
| 115 env.AddNodeToTestSuite(node, ['small_tests'], 'cond_wait_test', | 122 env.AddNodeToTestSuite(node, ['small_tests'], 'cond_wait_test', |
| 116 is_broken=is_broken) | 123 is_broken=is_broken) |
| 117 | 124 |
| 118 env.ComponentProgram('thread_stack_test.nexe', | 125 thread_stack_test_nexe = env.ComponentProgram('thread_stack_test', |
| 119 'thread_stack_test.c', | 126 'thread_stack_test.c', |
| 120 EXTRA_LIBS=['pthread'], | 127 EXTRA_LIBS=['pthread']) |
| 121 ) | 128 |
| 122 node = env.CommandSelLdrTestNacl( | 129 node = env.CommandSelLdrTestNacl( |
| 123 'thread_stack_test.out', | 130 'thread_stack_test.out', |
| 124 command=[env.File('thread_stack_test.nexe')], | 131 thread_stack_test_nexe, |
| 125 size='small', | 132 size='small', |
| 126 ) | 133 ) |
| 127 env.AddNodeToTestSuite(node, ['small_tests'], 'run_thread_stack_test', | 134 env.AddNodeToTestSuite(node, ['small_tests'], 'run_thread_stack_test', |
| 128 is_broken=is_broken) | 135 is_broken=is_broken) |
| 129 | 136 |
| 130 test_prog = env.ComponentProgram('second_tls_test.nexe', | 137 second_tls_test_nexe = env.ComponentProgram( |
| 131 env.RawSyscallObjects(['second_tls_test.c']), | 138 'second_tls_test', |
| 132 EXTRA_LIBS=['pthread']) | 139 env.RawSyscallObjects(['second_tls_test.c']), |
| 140 EXTRA_LIBS=['pthread']) |
| 141 |
| 133 node = env.CommandSelLdrTestNacl('second_tls_test.out', | 142 node = env.CommandSelLdrTestNacl('second_tls_test.out', |
| 134 command=[env.File(test_prog)]) | 143 second_tls_test_nexe) |
| 135 env.AddNodeToTestSuite(node, ['small_tests'], 'run_second_tls_test', | 144 env.AddNodeToTestSuite(node, ['small_tests'], 'run_second_tls_test', |
| 136 is_broken=is_broken) | 145 is_broken=is_broken) |
| OLD | NEW |