Index: tests/untrusted_crash_dump/nacl.scons |
diff --git a/tests/untrusted_crash_dump/nacl.scons b/tests/untrusted_crash_dump/nacl.scons |
new file mode 100644 |
index 0000000000000000000000000000000000000000..f489c4ac09b918e71ac3d8511da48f8260aa4962 |
--- /dev/null |
+++ b/tests/untrusted_crash_dump/nacl.scons |
@@ -0,0 +1,92 @@ |
+# -*- python -*- |
+# Copyright (c) 2012 The Native Client Authors. All rights reserved. |
+# Use of this source code is governed by a BSD-style license that can be |
+# found in the LICENSE file. |
+ |
+Import('env') |
+ |
+# Keep frame pointers so we get a nice stack trace. |
+# Set -O0 as otherwise some of the layers in the test case get optimized away. |
+env.Append(CCFLAGS=['-O0', '-fno-omit-frame-pointer', '-g']) |
+env['COMPONENT_STATIC'] = not env.Bit('nacl_glibc') |
+env['ENV']['NACL_UNTRUSTED_EXCEPTION_HANDLING'] = '1' |
+ |
+# TODO(bradnelson): Support x86-64 and pnacl when the frame pointer is provided |
+# to the exception handler for those platforms. |
+if not env.Bit('build_x86_32') or env.Bit('bitcode'): |
+ Return() |
+ |
+untrusted_crash_dump_lib = env.ComponentLibrary( |
+ 'untrusted_crash_dump_lib', |
+ 'untrusted_crash_dump_lib.c', |
+ EXTRA_LIBS=['${PTHREAD_LIBS}', '${NONIRT_LIBS}']) |
+ |
+untrusted_crash_dump_test = env.ComponentProgram( |
+ 'untrusted_crash_dump_test', |
+ 'untrusted_crash_dump_test.c', |
+ EXTRA_LIBS=['untrusted_crash_dump_lib', |
+ 'untrusted_crash_dump', |
+ '${PTHREAD_LIBS}', '${NONIRT_LIBS}']) |
+ |
+ |
+dump_file = env.File('untrusted_crash_dump_test_core.json') |
+run_test = env.CommandSelLdrTestNacl( |
+ 'untrusted_crash_dump_test_run.out', |
+ untrusted_crash_dump_test, |
+ exit_status=166, |
+ sel_ldr_flags=['-a', '-E', 'NACLCOREFILE=' + dump_file.abspath]) |
+env.AlwaysBuild(run_test) |
+env.SideEffect(dump_file, run_test) |
+node = env.Command('untrusted_crash_dump_test.out', |
+ ['untrusted_crash_dump_test.py', |
+ dump_file, untrusted_crash_dump_test], |
+ '${PYTHON} ${SOURCES} - ${ADDR2LINE} ${NACL_SDK_LIB}') |
+env.AddNodeToTestSuite( |
+ node, ['small_tests'], |
+ 'run_untrusted_crash_dump_test') |
+ |
+# |
+# Similar stuff, but in the browser. |
+# |
+ |
+untrusted_crash_dump_test = env.ComponentProgram( |
+ 'inbrowser_untrusted_crash_dump_test', |
+ env.ComponentObject( |
+ 'inbrowser_untrusted_crash_dump_test', |
+ 'untrusted_crash_dump_test.c'), |
+ EXTRA_LIBS=['untrusted_crash_dump_lib', |
+ 'untrusted_crash_dump', |
+ 'platform', 'gio', 'imc', 'imc_syscalls', |
+ '${PTHREAD_LIBS}', '${NON_PPAPI_BROWSER_LIBS}']) |
+ |
+# Make sure .so is in place for decoding. |
+if env.Bit('nacl_glibc'): |
+ env.Depends(untrusted_crash_dump_test, |
+ '${LIB_DIR}/${SHLIBPREFIX}untrusted_crash_dump_lib${SHLIBSUFFIX}') |
+ |
+crash_dump = ('${TARGET_ROOT}/test_results/' |
+ 'inbrowser_untrusted_crash_dump_test.stdout') |
+run_test = env.PPAPIBrowserTester( |
+ 'inbrowser_untrusted_crash_dump_test_run.out', |
+ url='untrusted_crash_dump.html', |
+ nmfs=['untrusted_crash_dump_test.nmf'], |
+ nacl_exe_stdout={ |
+ 'file': crash_dump, |
+ }, |
+ files=[untrusted_crash_dump_test, |
+ env.File('untrusted_crash_dump.html')]) |
+env.AlwaysBuild(run_test) |
+node = env.Command( |
+ 'inbrowser_untrusted_crash_dump_test.out', |
+ ['untrusted_crash_dump_test.py', |
+ crash_dump, untrusted_crash_dump_test, |
+ '${STAGING_DIR}/untrusted_crash_dump_test.nmf'], |
+ '${PYTHON} ${SOURCES} ${ADDR2LINE} ${NACL_SDK_LIB}') |
+env.AddNodeToTestSuite( |
+ node, ['chrome_browser_tests'], |
+ 'run_inbrowser_untrusted_crash_dump_test', |
+ is_broken=env.PPAPIBrowserTesterIsBroken() or |
+ env.Bit('running_on_valgrind') or |
+ # TODO(bradnelson): Once we have proper support for running |
+ # in Chrome, remove this limitation. |
+ env.Bit('disable_dynamic_plugin_loading')) |