OLD | NEW |
(Empty) | |
| 1 # -*- python -*- |
| 2 # Copyright (c) 2012 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('env') |
| 7 |
| 8 # Keep frame pointers so we get a nice stack trace. |
| 9 # Set -O0 as otherwise some of the layers in the test case get optimized away. |
| 10 env.Append(CCFLAGS=['-O0', '-fno-omit-frame-pointer', '-g']) |
| 11 env['COMPONENT_STATIC'] = not env.Bit('nacl_glibc') |
| 12 env['ENV']['NACL_UNTRUSTED_EXCEPTION_HANDLING'] = '1' |
| 13 |
| 14 # TODO(bradnelson): Support x86-64 and pnacl when the frame pointer is provided |
| 15 # to the exception handler for those platforms. |
| 16 if not env.Bit('build_x86_32') or env.Bit('bitcode'): |
| 17 Return() |
| 18 |
| 19 untrusted_crash_dump_lib = env.ComponentLibrary( |
| 20 'untrusted_crash_dump_lib', |
| 21 'untrusted_crash_dump_lib.c', |
| 22 EXTRA_LIBS=['${PTHREAD_LIBS}', '${NONIRT_LIBS}']) |
| 23 |
| 24 untrusted_crash_dump_test = env.ComponentProgram( |
| 25 'untrusted_crash_dump_test', |
| 26 'untrusted_crash_dump_test.c', |
| 27 EXTRA_LIBS=['untrusted_crash_dump_lib', |
| 28 'untrusted_crash_dump', |
| 29 '${PTHREAD_LIBS}', '${NONIRT_LIBS}']) |
| 30 |
| 31 |
| 32 dump_file = env.File('untrusted_crash_dump_test_core.json') |
| 33 run_test = env.CommandSelLdrTestNacl( |
| 34 'untrusted_crash_dump_test_run.out', |
| 35 untrusted_crash_dump_test, |
| 36 exit_status=166, |
| 37 sel_ldr_flags=['-a', '-E', 'NACLCOREFILE=' + dump_file.abspath]) |
| 38 env.AlwaysBuild(run_test) |
| 39 env.SideEffect(dump_file, run_test) |
| 40 node = env.Command('untrusted_crash_dump_test.out', |
| 41 ['untrusted_crash_dump_test.py', |
| 42 dump_file, untrusted_crash_dump_test], |
| 43 '${PYTHON} ${SOURCES} - ${ADDR2LINE} ${NACL_SDK_LIB}') |
| 44 env.AddNodeToTestSuite( |
| 45 node, ['small_tests'], |
| 46 'run_untrusted_crash_dump_test') |
| 47 |
| 48 # |
| 49 # Similar stuff, but in the browser. |
| 50 # |
| 51 |
| 52 untrusted_crash_dump_test = env.ComponentProgram( |
| 53 'inbrowser_untrusted_crash_dump_test', |
| 54 env.ComponentObject( |
| 55 'inbrowser_untrusted_crash_dump_test', |
| 56 'untrusted_crash_dump_test.c'), |
| 57 EXTRA_LIBS=['untrusted_crash_dump_lib', |
| 58 'untrusted_crash_dump', |
| 59 'platform', 'gio', 'imc', 'imc_syscalls', |
| 60 '${PTHREAD_LIBS}', '${NON_PPAPI_BROWSER_LIBS}']) |
| 61 |
| 62 # Make sure .so is in place for decoding. |
| 63 if env.Bit('nacl_glibc'): |
| 64 env.Depends(untrusted_crash_dump_test, |
| 65 '${LIB_DIR}/${SHLIBPREFIX}untrusted_crash_dump_lib${SHLIBSUFFIX}') |
| 66 |
| 67 crash_dump = ('${TARGET_ROOT}/test_results/' |
| 68 'inbrowser_untrusted_crash_dump_test.stdout') |
| 69 run_test = env.PPAPIBrowserTester( |
| 70 'inbrowser_untrusted_crash_dump_test_run.out', |
| 71 url='untrusted_crash_dump.html', |
| 72 nmfs=['untrusted_crash_dump_test.nmf'], |
| 73 nacl_exe_stdout={ |
| 74 'file': crash_dump, |
| 75 }, |
| 76 files=[untrusted_crash_dump_test, |
| 77 env.File('untrusted_crash_dump.html')]) |
| 78 env.AlwaysBuild(run_test) |
| 79 node = env.Command( |
| 80 'inbrowser_untrusted_crash_dump_test.out', |
| 81 ['untrusted_crash_dump_test.py', |
| 82 crash_dump, untrusted_crash_dump_test, |
| 83 '${STAGING_DIR}/untrusted_crash_dump_test.nmf'], |
| 84 '${PYTHON} ${SOURCES} ${ADDR2LINE} ${NACL_SDK_LIB}') |
| 85 env.AddNodeToTestSuite( |
| 86 node, ['chrome_browser_tests'], |
| 87 'run_inbrowser_untrusted_crash_dump_test', |
| 88 is_broken=env.PPAPIBrowserTesterIsBroken() or |
| 89 env.Bit('running_on_valgrind') or |
| 90 # TODO(bradnelson): Once we have proper support for running |
| 91 # in Chrome, remove this limitation. |
| 92 env.Bit('disable_dynamic_plugin_loading')) |
OLD | NEW |