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..c57318b3e234ae582e8297945fcf11e299b491db |
--- /dev/null |
+++ b/tests/untrusted_crash_dump/nacl.scons |
@@ -0,0 +1,54 @@ |
+# -*- 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') |
+ |
+ |
+# Exception handling support is only implemented for x86-32 Windows. |
+is_broken = (not (env.Bit('host_windows') or env.Bit('host_mac')) or |
Mark Seaborn
2012/02/09 22:24:55
You can drop this because we have exception handli
bradn
2012/02/11 01:04:14
Already done in later patch set.
|
+ not env.Bit('build_x86_32')) |
+ |
+# Don't build on anything other than x86-32 for now. |
+if not env.Bit('build_x86_32'): |
+ Return() |
+ |
+env.Append(CCFLAGS=['-O0', '-fno-omit-frame-pointer', '-g']) |
+ |
+untrusted_crash_dump_lib = env.ComponentLibrary( |
+ 'untrusted_crash_dump_lib', |
+ 'untrusted_crash_dump_lib.c', |
+ EXTRA_LIBS=['${PTHREAD_LIBS}', '${NONIRT_LIBS}'], |
+ COMPONENT_STATIC=not env.Bit('nacl_glibc')) |
+ |
+untrusted_crash_dump_test = env.ComponentProgram( |
+ 'untrusted_crash_dump_test', |
+ ['untrusted_crash_dump.c', 'untrusted_crash_dump_test.c'], |
+ EXTRA_LIBS=['untrusted_crash_dump_lib', |
+ '${PTHREAD_LIBS}', '${NONIRT_LIBS}']) |
+ |
+env['ENV']['NACL_UNTRUSTED_EXCEPTION_HANDLING'] = '1' |
Mark Seaborn
2012/02/09 22:24:55
env['ENV'] *might* be shared across all the .scons
bradn
2012/02/11 01:04:14
BuildEnvironments clones env deeply. I've also che
|
+ |
+if env.Bit('nacl_glibc'): |
+ golden = 'untrusted_crash_dump_test_glibc.golden' |
+else: |
+ golden = 'untrusted_crash_dump_test_newlib.golden' |
+golden = '$MAIN_DIR/tests/untrusted_crash_dump/' + golden |
+ |
+dump_file = env.File('untrusted_crash_dump_test_core.json') |
+processed = env.File('untrusted_crash_dump_test.trace').abspath |
+node = 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.SideEffect(dump_file, node) |
+env.AddPostAction( |
Mark Seaborn
2012/02/09 22:24:55
Can't this be a separate Scons target that depends
bradn
2012/02/11 01:04:14
Done.
|
+ node, env.UntrustedCrashDumpFilter( |
+ processed, dump_file.abspath, untrusted_crash_dump_test.abspath)) |
+env.AddPostAction( |
+ node, env.GoldenFileCheckAction(processed, golden)) |
+env.AddNodeToTestSuite( |
+ node, ['small_tests', 'exception_tests'], |
+ 'run_untrusted_crash_dump_test', is_broken=is_broken) |