Chromium Code Reviews| 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..a9ad3aef2fa4834334f996349dbb20908ca25a7c |
| --- /dev/null |
| +++ b/tests/untrusted_crash_dump/nacl.scons |
| @@ -0,0 +1,100 @@ |
| +# -*- 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') |
| + |
| +env.Append(CCFLAGS=['-O0', '-fno-omit-frame-pointer', '-g']) |
|
Mark Seaborn
2012/02/16 18:42:50
In general gcc's debugging info is meant to work w
bradn
2012/02/16 20:13:10
Done.
|
| +env['COMPONENT_STATIC'] = not env.Bit('nacl_glibc') |
| + |
| +# TODO(bradnelson): Add x86-64 support when frame point is available there. |
|
Mark Seaborn
2012/02/16 18:42:50
'pointer'
bradn
2012/02/16 20:13:10
Done.
|
| +if not env.Bit('build_x86_32'): |
| + Return() |
| + |
| +# Clone env for inbrowser version. |
| +env_browser = env.Clone() |
|
Mark Seaborn
2012/02/16 18:42:50
Move this to just before it's used?
bradn
2012/02/16 20:13:10
Done.
|
| + |
| +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}']) |
| + |
| +env['ENV']['NACL_UNTRUSTED_EXCEPTION_HANDLING'] = '1' |
| + |
| +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) |
|
Mark Seaborn
2012/02/16 18:42:50
Isn't this unnecessary, given that the ".out" file
bradn
2012/02/16 20:13:10
Scons in its infinite wisdom touches outputs (so t
|
| +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_lib = env_browser.ComponentLibrary( |
|
Mark Seaborn
2012/02/16 18:42:50
Does this library need to be built a second time?
bradn
2012/02/16 20:13:10
Done.
|
| + 'inbrowser_untrusted_crash_dump_lib', |
| + env_browser.ComponentObject('inbrowser_untrusted_crash_dump_lib', |
| + 'untrusted_crash_dump_lib.c', |
| + ), |
|
Mark Seaborn
2012/02/16 18:42:50
Put ')' on previous line
bradn
2012/02/16 20:13:10
Done.
|
| + EXTRA_LIBS=['srpc', 'platform', 'gio', 'imc', 'imc_syscalls', |
|
Mark Seaborn
2012/02/16 18:42:50
'srpc' shouldn't be needed
bradn
2012/02/16 20:13:10
Done.
|
| + '${PTHREAD_LIBS}', '${NON_PPAPI_BROWSER_LIBS}']) |
| + |
| +untrusted_crash_dump_test = env_browser.ComponentProgram( |
| + 'inbrowser_untrusted_crash_dump_test', |
| + env_browser.ComponentObject( |
| + 'inbrowser_untrusted_crash_dump_test', |
| + '${MAIN_DIR}/tests/untrusted_crash_dump/untrusted_crash_dump_test.c'), |
|
Mark Seaborn
2012/02/16 18:42:50
Just use a relative path?
bradn
2012/02/16 20:13:10
Done.
|
| + EXTRA_LIBS=['inbrowser_untrusted_crash_dump_lib', |
| + 'untrusted_crash_dump', |
| + 'srpc', 'platform', 'gio', 'imc', 'imc_syscalls', |
|
Mark Seaborn
2012/02/16 18:42:50
'srpc' shouldn't be needed
bradn
2012/02/16 20:13:10
Done.
|
| + '${PTHREAD_LIBS}', '${NON_PPAPI_BROWSER_LIBS}']) |
| + |
| +# Make sure .so is in place for decoding. |
| +if env_browser.Bit('nacl_glibc'): |
| + env_browser.Depends(untrusted_crash_dump_test, |
| + '$STAGING_DIR/libinbrowser_untrusted_crash_dump_lib.so') |
| + |
| +env_browser['ENV']['NACL_UNTRUSTED_EXCEPTION_HANDLING'] = '1' |
| +crash_dump = ('${TARGET_ROOT}/test_results/' |
| + 'inbrowser_untrusted_crash_dump_test.stdout') |
| +run_test = env_browser.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_browser.File('untrusted_crash_dump.html')]) |
| +env.AlwaysBuild(run_test) |
|
Mark Seaborn
2012/02/16 18:42:50
As above
bradn
2012/02/16 20:13:10
See above.
|
| +env.SideEffect(crash_dump, run_test) |
|
Mark Seaborn
2012/02/16 18:42:50
PPAPIBrowserTester() ought to take care of declari
bradn
2012/02/16 20:13:10
Done.
|
| +node = env_browser.Command( |
| + 'inbrowser_untrusted_crash_dump_test.out', |
| + ['untrusted_crash_dump_test.py', |
| + crash_dump, untrusted_crash_dump_test, |
|
Mark Seaborn
2012/02/16 18:42:50
Indent -1
bradn
2012/02/16 20:13:10
Done.
|
| + '${STAGING_DIR}/untrusted_crash_dump_test.nmf'], |
| + '${PYTHON} ${SOURCES} ${ADDR2LINE} ${NACL_SDK_LIB}') |
| +env_browser.AddNodeToTestSuite( |
| + node, ['chrome_browser_tests'], |
| + 'run_inbrowser_untrusted_crash_dump_test', |
|
Mark Seaborn
2012/02/16 18:42:50
Indent -3
bradn
2012/02/16 20:13:10
Done.
|
| + is_broken=env_browser.PPAPIBrowserTesterIsBroken() or |
| + env_browser.Bit('running_on_valgrind') or |
| + env_browser.Bit('disable_dynamic_plugin_loading')) |
|
Mark Seaborn
2012/02/16 18:42:50
Comment disable_dynamic_plugin_loading with a TODO
bradn
2012/02/16 20:13:10
Done.
|