Index: SConstruct |
diff --git a/SConstruct b/SConstruct |
index 919b1c771fe3d87a0b5f3d01dab074fbfc9d47fb..7a46dc5d08dc0760b564dabbe9b0a859158f3bed 100755 |
--- a/SConstruct |
+++ b/SConstruct |
@@ -1192,6 +1192,9 @@ def CommandValidatorTestNacl(env, name, image, |
if validator_flags is None: |
validator_flags = [] |
+ if env.Bit('pnacl_stop_with_pexe'): |
robertm
2012/03/13 21:53:15
I am not a big fan of the "late kill",
it would be
(google.com) Derek Schuff
2012/03/13 21:59:27
Maybe... until someone else tries to add another v
|
+ return [] |
+ |
command = [validator] + validator_flags + [image] |
return CommandTest(env, name, command, size, **extra) |
@@ -1950,6 +1953,19 @@ def ShouldUseVerboseOptions(extra): |
# ---------------------------------------------------------- |
DeclareBit('tests_use_irt', 'Non-browser tests also load the IRT image', False) |
+# Translate the given pexe. Return the name of the translated nexe and |
Mark Seaborn
2012/03/13 22:16:55
Sentence not completed.
|
+def GetTranslatedNexe(env, pexe): |
+ pexe_name = pexe.abspath |
+ nexe_name = pexe_name[:pexe_name.index('.pexe')] + '.nexe' |
+ trans_flags = [] |
Mark Seaborn
2012/03/13 22:16:55
trans_flag is not used.
|
+ trans_cmd = ('${TRANSLATE} ${TRANSLATEFLAGS} -Wl,-L${LIB_DIR} %s -o %s' % |
+ (pexe_name, nexe_name)) |
+ |
+ pexe_node = env.Command(nexe_name, pexe_name, trans_cmd) |
+ return nexe_name, pexe_node |
Mark Seaborn
2012/03/13 22:16:55
In the call sites, nexe_name is not used.
|
+ |
+pre_base_env.AddMethod(GetTranslatedNexe) |
+ |
def CommandSelLdrTestNacl(env, name, nexe, |
args = None, |
log_verbosity=2, |
@@ -1971,7 +1987,15 @@ def CommandSelLdrTestNacl(env, name, nexe, |
env['TRUSTED_ENV'].Bit('windows')): |
return [] |
- command = [nexe] |
+ if (env.Bit('pnacl_stop_with_pexe') and env['NACL_BUILD_FAMILY'] != 'TRUSTED'): |
+ # The nexe is actually a pexe. translate it before we run it |
+ nexe_name, pexe_node = GetTranslatedNexe(env, nexe) |
+ command = [nexe_name] |
+ extra_deps = [pexe_node] |
+ else: |
+ command = [nexe] |
+ extra_deps = [] |
+ |
if args is not None: |
command += args |
@@ -2025,7 +2049,8 @@ def CommandSelLdrTestNacl(env, name, nexe, |
env.MakeVerboseExtraOptions(name, log_verbosity, extra) |
node = CommandTest(env, name, command, size, posix_path=True, |
- wrapper_program_prefix=wrapper_program_prefix, **extra) |
+ wrapper_program_prefix=wrapper_program_prefix, |
+ extra_deps=extra_deps, **extra) |
if env.Bit('tests_use_irt'): |
env.Alias('irt_tests', node) |
return node |