Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(179)

Unified Diff: SConstruct

Issue 9316125: Adding untrusted crash dump / stack trace tests. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: fixing 64-bit build issue Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | site_scons/site_tools/naclsdk.py » ('j') | src/trusted/service_runtime/build.scons » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: SConstruct
diff --git a/SConstruct b/SConstruct
index a4865f9948b8b0bd84311d5e75b0ff07733ede72..af36778e704f9f38e120730b6cc9dda3e4082532 100755
--- a/SConstruct
+++ b/SConstruct
@@ -1136,7 +1136,7 @@ def SConstructAbsPath(env, path):
pre_base_env.AddMethod(SConstructAbsPath)
-def GetSelLdr(env):
+def GetSelLdr(env, with_exceptions=False):
sel_ldr = ARGUMENTS.get('force_sel_ldr')
if sel_ldr:
return env.File(env.SConstructAbsPath(sel_ldr))
@@ -1146,7 +1146,12 @@ def GetSelLdr(env):
return None
trusted_env = env['TRUSTED_ENV']
- return trusted_env.File('${STAGING_DIR}/${PROGPREFIX}sel_ldr${PROGSUFFIX}')
+ # TODO(bradnelson): drop once exceptions are available by default.
+ if with_exceptions:
+ return trusted_env.File(
+ '${STAGING_DIR}/${PROGPREFIX}sel_ldr_exc${PROGSUFFIX}')
+ else:
+ return trusted_env.File('${STAGING_DIR}/${PROGPREFIX}sel_ldr${PROGSUFFIX}')
def GetBootstrap(env):
if 'TRUSTED_ENV' in env:
@@ -1450,7 +1455,8 @@ pre_base_env.AddMethod(GetPnaclExtensionNode)
# If they are different, prints the difference and returns 1.
# Otherwise, returns 0.
def CheckGoldenFile(golden_file, output_file,
- filter_regex, filter_inverse, filter_group_only):
+ filter_regex=None,
+ filter_inverse=None, filter_group_only=None):
golden = open(golden_file).read()
actual = open(output_file).read()
if filter_regex is not None:
@@ -1476,6 +1482,25 @@ def GoldenFileCheckAction(env, output_file, golden_file,
return env.Action(ActionFunc)
+pre_base_env.AddMethod(GoldenFileCheckAction)
+
+
+def UntrustedCrashDumpFilter(env, target, source, nexe=None, nmf=None):
+ cmd = ('${PYTHON} ' +
Mark Seaborn 2012/02/06 19:44:06 Use AutoDepsCommand() instead of concatenating the
bradn 2012/02/06 22:27:48 This is an action not a command, so reusing AutoDe
+ env.File(
+ '$MAIN_DIR/tests/untrusted_crash_dump/decode_dump.py').abspath +
+ ' ' + env.subst(source) +
+ ' ' + env.subst(target) +
+ ' --addr2line ${ADDR2LINE}'
+ ' --toolchain-libs ${NACL_SDK_LIB}')
+ if nexe:
+ cmd += ' --main-nexe ' + env.subst(nexe)
+ if nmf:
+ cmd += ' --nmf ' + env.subst(nmf)
+ return env.Action(cmd)
+
+pre_base_env.AddMethod(UntrustedCrashDumpFilter)
+
def PPAPIBrowserTester(env,
target,
@@ -1497,6 +1522,7 @@ def PPAPIBrowserTester(env,
nacl_exe_stdout=None,
nacl_exe_stderr=None,
python_tester_script=None,
+ with_exceptions=False,
**extra):
if 'TRUSTED_ENV' not in env:
return []
@@ -1533,7 +1559,7 @@ def PPAPIBrowserTester(env,
'--timeout', str(timeout)]
if not env.Bit('disable_dynamic_plugin_loading'):
command.extend(['--ppapi_plugin', GetPPAPIPluginPath(env['TRUSTED_ENV'])])
- command.extend(['--sel_ldr', GetSelLdr(env)])
+ command.extend(['--sel_ldr', GetSelLdr(env, with_exceptions)])
bootstrap, _ = GetBootstrap(env)
if bootstrap is not None:
command.extend(['--sel_ldr_bootstrap', bootstrap])
@@ -1553,9 +1579,11 @@ def PPAPIBrowserTester(env,
command.extend(['--mime_type', file_ext, mime_type])
command.extend(['--serving_dir', '${NACL_SDK_LIB}'])
command.extend(['--serving_dir', '${LIB_DIR}'])
+ generated_manifests = []
if not nmfs is None:
for nmf_file in nmfs:
generated_manifest = GeneratedManifestNode(env, nmf_file)
+ generated_manifests.append(generated_manifest)
# We need to add generated manifests to the list of default targets.
# The manifests should be generated even if the tests are not run -
# the manifests may be needed for manual testing.
@@ -1598,9 +1626,20 @@ def PPAPIBrowserTester(env,
filter_regex = params.get('filter_regex', None)
filter_inverse = params.get('filter_inverse', False)
filter_group_only = params.get('filter_group_only', False)
+ decode_crash_dump = params.get('decode_crash_dump', False)
+ if decode_crash_dump:
+ if generated_manifests:
+ nmf_path = generated_manifests[0].abspath
+ else:
+ nmf_path = None
+ decoded = stream_file + '.decoded'
+ post_actions.append(
+ env.UntrustedCrashDumpFilter(
+ decoded, stream_file, nexe=files[0].abspath, nmf=nmf_path))
+ stream_file = decoded
post_actions.append(
- GoldenFileCheckAction(
- env, stream_file, golden_file,
+ env.GoldenFileCheckAction(
+ stream_file, golden_file,
filter_regex, filter_inverse, filter_group_only))
if ShouldUseVerboseOptions(extra):
@@ -3206,6 +3245,7 @@ irt_variant_tests = [
'tests/toolchain/nacl.scons',
'tests/unittests/shared/platform/nacl.scons',
'tests/untrusted_check/nacl.scons',
+ 'tests/untrusted_crash_dump/nacl.scons',
#### ALPHABETICALLY SORTED ####
]
@@ -3221,6 +3261,7 @@ nonvariant_tests = [
'tests/imc_shm_mmap/nacl.scons',
'tests/imc_sockets/nacl.scons',
'tests/inbrowser_crash_test/nacl.scons',
+ 'tests/inbrowser_untrusted_crash_dump_test/nacl.scons',
'tests/inbrowser_test_runner/nacl.scons',
'tests/mach_crash_filter/nacl.scons',
'tests/minnacl/nacl.scons',
« no previous file with comments | « no previous file | site_scons/site_tools/naclsdk.py » ('j') | src/trusted/service_runtime/build.scons » ('J')

Powered by Google App Engine
This is Rietveld 408576698