Chromium Code Reviews| Index: SConstruct |
| diff --git a/SConstruct b/SConstruct |
| index 919b1c771fe3d87a0b5f3d01dab074fbfc9d47fb..79414466359e51e3248fbc5e34c9e4941ead560f 100755 |
| --- a/SConstruct |
| +++ b/SConstruct |
| @@ -1192,8 +1192,15 @@ def CommandValidatorTestNacl(env, name, image, |
| if validator_flags is None: |
| validator_flags = [] |
| + if (env.Bit('pnacl_stop_with_pexe') and env['NACL_BUILD_FAMILY'] != 'TRUSTED'): |
|
robertm
2012/03/13 20:57:51
I think it would be ok to simple skip the validato
jvoung - send to chromium...
2012/03/13 20:58:31
80 col (barely)
(google.com) Derek Schuff
2012/03/13 21:23:03
hm. since the only place this is used is the whole
|
| + # image is a pexe rather than a nexe |
| + image, dep = GetTranslatedNexe(env, image) |
| + extra_deps = [dep] |
| + else: |
| + extra_deps = [] |
| + |
| command = [validator] + validator_flags + [image] |
| - return CommandTest(env, name, command, size, **extra) |
| + return CommandTest(env, name, command, size, extra_deps=extra_deps, **extra) |
| pre_base_env.AddMethod(CommandValidatorTestNacl) |
| @@ -1950,6 +1957,21 @@ 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 |
| +def GetTranslatedNexe(env, pexe): |
| + pexe_name = pexe.abspath |
| + nexe_name = pexe_name[:pexe_name.index('.pexe')] + '.nexe' |
| + trans_flags = [] |
| + if 'TRANSLATEFLAGS' in env: |
| + trans_flags = env['TRANSLATEFLAGS'] |
| + translate_command = ' '.join([env['TRANSLATE']] + trans_flags + [pexe_name, |
|
jvoung - send to chromium...
2012/03/13 20:58:31
Would it work if you let scons do the env interpol
(google.com) Derek Schuff
2012/03/13 21:23:03
yeah, that works.
On 2012/03/13 20:58:31, jvoung w
|
| + '-o', nexe_name, '-Wl,-L' + '${LIB_DIR}']) |
| + |
| + pexe_node = env.Command(nexe_name, pexe_name, translate_command) |
| + return nexe_name, pexe_node |
| + |
| +pre_base_env.AddMethod(GetTranslatedNexe) |
| + |
| def CommandSelLdrTestNacl(env, name, nexe, |
| args = None, |
| log_verbosity=2, |
| @@ -1971,7 +1993,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'): |
|
jvoung - send to chromium...
2012/03/13 20:58:31
80 col (barely)
(google.com) Derek Schuff
2012/03/13 21:23:03
punting this because the name change fixes it :P
O
jvoung - send to chromium...
2012/03/13 21:41:23
=) sounds good.
|
| + # 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 +2055,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 |