| OLD | NEW |
| (Empty) |
| 1 # -*- python -*- | |
| 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 | |
| 4 # found in the LICENSE file. | |
| 5 | |
| 6 import os | |
| 7 | |
| 8 Import('env') | |
| 9 | |
| 10 # This tests a feature that is currently only in nacl-glibc's dynamic | |
| 11 # linker. | |
| 12 if not env.Bit('nacl_glibc'): | |
| 13 Return() | |
| 14 if env.Bit('nacl_static_link'): | |
| 15 Return() | |
| 16 # nacl-glibc tests are currently only run on Linux and the plumbing | |
| 17 # for Python bindings will require more work for Mac and Windows. | |
| 18 # TODO(mseaborn): Share a common set of checks and plumbing with | |
| 19 # src/trusted/python_bindings/build.scons. | |
| 20 if not env.Bit('host_linux'): | |
| 21 Return() | |
| 22 # Disable for x86-32 in case this is a multilib target, since Python | |
| 23 # does not support multilib. See src/trusted/python_bindings/build.scons. | |
| 24 if env.Bit('build_x86_32'): | |
| 25 Return() | |
| 26 | |
| 27 if 'TRUSTED_ENV' not in env: | |
| 28 Return() | |
| 29 trusted_env = env['TRUSTED_ENV'] | |
| 30 | |
| 31 python_extension = trusted_env.File('${STAGING_DIR}/naclimc.so') | |
| 32 | |
| 33 sel_ldr = trusted_env.File('${STAGING_DIR}/${PROGPREFIX}sel_ldr${PROGSUFFIX}') | |
| 34 hello_world = env.File('${STAGING_DIR}/hello_world${PROGSUFFIX}') | |
| 35 env_vars = [ | |
| 36 'PYTHONPATH=%s' % ':'.join([os.path.dirname(python_extension.abspath), | |
| 37 '${SCONSTRUCT_DIR}/src/tools/posix_over_imc']), | |
| 38 'NACL_SEL_LDR=%s' % sel_ldr, | |
| 39 'HELLO_WORLD_PROG=%s' % hello_world, | |
| 40 'NACL_LIBRARY_DIR=${NACL_SDK_LIB}', | |
| 41 ] | |
| 42 dependencies = [python_extension, sel_ldr, hello_world] | |
| 43 | |
| 44 node = env.CommandTest( | |
| 45 'startup_message_test.out', | |
| 46 command=['${PYTHON}', env.File('test_startup.py')], | |
| 47 osenv=env_vars, | |
| 48 extra_deps=dependencies) | |
| 49 env.AddNodeToTestSuite(node, ['small_tests'], 'run_startup_message_test') | |
| OLD | NEW |