| OLD | NEW |
| 1 # -*- python -*- | 1 # -*- python -*- |
| 2 # Copyright 2011 The Native Client Authors. All rights reserved. | 2 # Copyright 2011 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 Import('env') | 6 Import('env') |
| 7 | 7 |
| 8 import sys | 8 import sys |
| 9 | 9 |
| 10 if 'TRUSTED_ENV' not in env: | 10 if 'TRUSTED_ENV' not in env: |
| 11 Return() | 11 Return() |
| 12 trusted_env = env['TRUSTED_ENV'] | 12 trusted_env = env['TRUSTED_ENV'] |
| 13 | 13 |
| 14 # The debug stub currently only works on x86-64. | 14 # The debug stub currently only works on x86-64. |
| 15 if not env.Bit('target_x86_64'): | 15 if not env.Bit('target_x86_64'): |
| 16 Return() | 16 Return() |
| 17 # The test has to be able to kill the subprocess. | 17 # The test has to be able to kill the subprocess. |
| 18 if sys.version_info < (2, 6): | 18 if sys.version_info < (2, 6): |
| 19 Return() | 19 Return() |
| 20 # Our test uses inline assembly. | 20 # Our test uses inline assembly. |
| 21 if env.Bit('bitcode'): | 21 if env.Bit('bitcode'): |
| 22 Return() | 22 Return() |
| 23 | 23 |
| 24 test_prog = env.ComponentProgram('debugger_test.nexe', 'debugger_test.c') | 24 test_prog = env.ComponentProgram('debugger_test', 'debugger_test.c') |
| 25 | 25 |
| 26 sel_ldr = trusted_env.File('${STAGING_DIR}/${PROGPREFIX}sel_ldr${PROGSUFFIX}') | 26 sel_ldr = trusted_env.File('${STAGING_DIR}/${PROGPREFIX}sel_ldr${PROGSUFFIX}') |
| 27 env_vars = [ | 27 env_vars = [ |
| 28 'NACL_SEL_LDR=%s' % sel_ldr, | 28 'NACL_SEL_LDR=%s' % sel_ldr, |
| 29 'DEBUGGER_TEST_PROG=%s' % test_prog.abspath, | 29 'DEBUGGER_TEST_PROG=%s' % test_prog.abspath, |
| 30 ] | 30 ] |
| 31 dependencies = [sel_ldr, test_prog] | 31 dependencies = [sel_ldr, test_prog] |
| 32 | 32 |
| 33 # TODO(mlinck) Fix the test to correctly kill sel_ldr, and check if the | 33 # TODO(mlinck) Fix the test to correctly kill sel_ldr, and check if the |
| 34 # port is already busy. This appears to be related to Hardy which is | 34 # port is already busy. This appears to be related to Hardy which is |
| 35 # why we are only turning this off on the coverage bots. | 35 # why we are only turning this off on the coverage bots. |
| 36 # See: | 36 # See: |
| 37 # http://code.google.com/p/nativeclient/issues/detail?id=1724 | 37 # http://code.google.com/p/nativeclient/issues/detail?id=1724 |
| 38 node = env.CommandTest( | 38 node = env.CommandTest( |
| 39 'debug_stub_test.out', | 39 'debug_stub_test.out', |
| 40 command=['${PYTHON}', env.File('debug_stub_test.py'), '-v'], | 40 command=['${PYTHON}', env.File('debug_stub_test.py'), '-v'], |
| 41 osenv=env_vars, | 41 osenv=env_vars, |
| 42 extra_deps=dependencies) | 42 extra_deps=dependencies) |
| 43 env.AddNodeToTestSuite(node, ['large_tests'], 'run_debug_stub_test') | 43 env.AddNodeToTestSuite(node, ['large_tests'], 'run_debug_stub_test') |
| 44 | 44 |
| 45 # Test debug_stub in Chrome -- currently this ONLY works on Windows | 45 # Test debug_stub in Chrome -- currently this ONLY works on Windows |
| 46 is_broken = not env.Bit('host_windows') | 46 is_broken = not env.Bit('host_windows') |
| 47 | 47 |
| 48 # Build .nexe to be used with debug_in_browswer test | 48 # Build .nexe to be used with debug_in_browswer test |
| 49 browser_test_target = 'debug_browser_test_%s.nexe' % env.get('TARGET_FULLARCH') | 49 browser_test_target = 'debug_browser_test_%s' % env.get('TARGET_FULLARCH') |
| 50 browser_test_nexe = env.ComponentProgram(browser_test_target, | 50 browser_test_nexe = env.ComponentProgram(browser_test_target, |
| 51 ['debug_browser_test.cc'], | 51 ['debug_browser_test.cc'], |
| 52 EXTRA_LIBS=['${PPAPI_LIBS}', | 52 EXTRA_LIBS=['${PPAPI_LIBS}', |
| 53 'ppapi_cpp'] | 53 'ppapi_cpp'] |
| 54 ) | 54 ) |
| 55 | 55 |
| 56 arch_suffix = '_%s.nexe' % env.get('TARGET_FULLARCH') | |
| 57 | |
| 58 # Note that the html and a .nmf manifest is required to run this program. | 56 # Note that the html and a .nmf manifest is required to run this program. |
| 59 dest_copy = env.Replicate('$STAGING_DIR', | 57 dest_copy = env.Replicate('$STAGING_DIR', |
| 60 ['debug_browser.html', | 58 ['debug_browser.html', |
| 61 'debug_browser_test.nmf']) | 59 'debug_browser_test.nmf']) |
| 62 | 60 |
| 63 | 61 |
| 64 env.Depends(browser_test_target, dest_copy) | 62 env.Depends(browser_test_target, dest_copy) |
| 65 test_files = [ | 63 test_files = [ |
| 66 browser_test_nexe, | 64 browser_test_nexe, |
| 67 env.File('$STAGING_DIR/nacltest.js'), | 65 env.File('$STAGING_DIR/nacltest.js'), |
| 68 env.File('$STAGING_DIR/debug_browser_test.nmf'), | 66 env.File('$STAGING_DIR/debug_browser_test.nmf'), |
| 69 env.File('$STAGING_DIR/debug_browser.html'), | 67 env.File('$STAGING_DIR/debug_browser.html'), |
| 70 env.File('$STAGING_DIR/debug_browser_test' + arch_suffix), | 68 env.File('$STAGING_DIR/%s${PROGSUFFIX}' % browser_test_target), |
| 71 ] | 69 ] |
| 72 | 70 |
| 73 # For now, we have to force this test to always run using chrome's | 71 # For now, we have to force this test to always run using chrome's |
| 74 # built-in NaCl and not with --register-pepper-plugins because | 72 # built-in NaCl and not with --register-pepper-plugins because |
| 75 # --enable-nacl-debug does not work with --register-pepper-plugins. | 73 # --enable-nacl-debug does not work with --register-pepper-plugins. |
| 76 # See: http://code.google.com/p/chromium/issues/detail?id=85070 | 74 # See: http://code.google.com/p/chromium/issues/detail?id=85070 |
| 77 # TODO(mmortensen) remove the debug_env lines below when issue 85070 | 75 # TODO(mmortensen) remove the debug_env lines below when issue 85070 |
| 78 # is resolved and a new-enough chrome gets DEPS'd in. | 76 # is resolved and a new-enough chrome gets DEPS'd in. |
| 79 # | 77 # |
| 80 # TODO(mmortensen) Get this test (along with other PyAuto tests) running | 78 # TODO(mmortensen) Get this test (along with other PyAuto tests) running |
| (...skipping 25 matching lines...) Expand all Loading... |
| 106 extra_chrome_flags=['--enable-nacl-debug','--no-sandbox'], | 104 extra_chrome_flags=['--enable-nacl-debug','--no-sandbox'], |
| 107 files=test_files | 105 files=test_files |
| 108 ) | 106 ) |
| 109 | 107 |
| 110 # TODO(mmortensen) Enable this test once chrome --enable-nacl-debug | 108 # TODO(mmortensen) Enable this test once chrome --enable-nacl-debug |
| 111 # works with --register-pepper-plugins. | 109 # works with --register-pepper-plugins. |
| 112 env.AddNodeToTestSuite(node, | 110 env.AddNodeToTestSuite(node, |
| 113 ['pyauto_tests'], | 111 ['pyauto_tests'], |
| 114 'run_pyauto_browser_debug_test_broken', | 112 'run_pyauto_browser_debug_test_broken', |
| 115 is_broken=True) | 113 is_broken=True) |
| OLD | NEW |