Chromium Code Reviews| Index: src/trusted/service_runtime/build.scons |
| diff --git a/src/trusted/service_runtime/build.scons b/src/trusted/service_runtime/build.scons |
| index c2c14a62dba24869488d0895426926e22f831d9d..408a157d91b8b8b22f53d4986970fc80f202f387 100644 |
| --- a/src/trusted/service_runtime/build.scons |
| +++ b/src/trusted/service_runtime/build.scons |
| @@ -554,10 +554,20 @@ elif env.Bit('target_x86_64'): |
| else: |
| arch_testdata_dir = 'testdata/' + env['TARGET_ARCHITECTURE'] |
| +if not env.Bit('bitcode') or env.Bit('target_mips32'): |
|
Mark Seaborn
2013/10/15 23:38:45
Why would this work for env.Bit('target_mips32') b
petarj
2013/10/16 00:24:37
This is a workaround to the issue with NO-NATIVE-C
|
| + untrusted_env = env.MakeUntrustedNativeEnv() |
| + hello_world_src = env.File('${MAIN_DIR}/tests/hello_world/hello_world.c') |
| + hello_world_obj = untrusted_env.ComponentObject('hello_world', |
| + hello_world_src) |
| + hello_world_nexe = untrusted_env.ComponentProgram( |
|
Mark Seaborn
2013/10/15 23:38:45
Can you do:
untrusted_env.File('$STAGING_DIR/hello
petarj
2013/10/16 23:36:08
Done.
|
| + 'hello_world', |
| + hello_world_obj, |
| + EXTRA_LIBS=['${NONIRT_LIBS}']) |
| # Doesn't work on windows under coverage. |
| # TODO(bradnelson): fix this to work on windows under coverage. |
| -if not env.Bit('windows') or not env.Bit('coverage_enabled'): |
| +if ((not env.Bit('windows') or not env.Bit('coverage_enabled')) and |
| + (not env.Bit('bitcode') or env.Bit('target_mips32'))): |
| # NOTE: uses validator |
| mmap_test_objs = [env.ComponentObject('mmap_test.c')] |
| mmap_test_exe = env.ComponentProgram( |
| @@ -580,8 +590,13 @@ if not env.Bit('windows') or not env.Bit('coverage_enabled'): |
| 'sel_test', |
| ]) |
| - mmap_test_file = env.File(arch_testdata_dir + '/hello_world.nexe') |
| - mmap_test_command = env.AddBootstrap(mmap_test_exe, [mmap_test_file]) |
| + if env.Bit('nacl_glibc'): |
| + mmap_test_args = ['%s/runnable-ld.so' % (untrusted_env['NACL_SDK_LIB'])] |
| + mmap_test_args = mmap_test_args + [hello_world_nexe] |
|
Mark Seaborn
2013/10/15 23:38:45
This is kind of misleading: since this test wouldn
petarj
2013/10/16 23:36:08
Done.
|
| + else: |
| + mmap_test_args = [hello_world_nexe] |
| + |
| + mmap_test_command = env.AddBootstrap(mmap_test_exe, mmap_test_args) |
| # TODO(robertm): This test emits lots of messages to stderr |
| node = env.CommandTest ( |
| @@ -801,7 +816,6 @@ env.AddNodeToTestSuite(node, ['small_tests'], 'run_sel_ldr_exe_not_found_test') |
| # Check that "-F" makes sel_ldr stop after loading the nexe but before running |
| # it. |
| if not env.Bit('bitcode') or env.Bit('target_mips32'): |
| - untrusted_env = env.MakeUntrustedNativeEnv() |
| nullptr_src = env.File('${MAIN_DIR}/tests/nullptr/nullptr.c') |
| nullptr_obj = untrusted_env.ComponentObject('nullptr', nullptr_src) |
| nullptr_nexe = untrusted_env.ComponentProgram('nullptr', nullptr_obj) |
| @@ -812,25 +826,12 @@ if not env.Bit('bitcode') or env.Bit('target_mips32'): |
| sel_ldr_flags=['-F']) |
| env.AddNodeToTestSuite(node, ['small_tests'], 'run_fuzz_nullptr_test') |
| -# ---------------------------------------------------------- |
| -# Small tests with canned binaries |
| -# ---------------------------------------------------------- |
| - |
| -if env.Bit('target_x86_64'): |
| - node = env.CommandSelLdrTestNacl( |
| - 'hello_x32.out', |
| - env.File(os.path.join(arch_testdata_dir, 'hello_x32.nexe')), |
| - stdout_golden=env.File(os.path.join('${MAIN_DIR}', |
| - 'tests/hello_world', |
| - 'hello_world.stdout')) |
| - ) |
| - env.AddNodeToTestSuite(node, ['small_tests'], 'run_hello_x32_test') |
| - |
| -# Test canned hello_world binary with obsolete, non-ragel based validator. |
| -if not env.Bit('validator_ragel') and env.Bit('target_x86'): |
| - node = env.CommandSelLdrTestNacl( |
| +# Test hello_world binary with obsolete, non-ragel based validator. |
| +if (not env.Bit('validator_ragel') and env.Bit('target_x86') and |
| + not env.Bit('bitcode')): |
| + node = untrusted_env.CommandSelLdrTestNacl( |
| 'dfa_hwd.out', |
| - env.File(arch_testdata_dir + '/hello_world.nexe'), |
| + hello_world_nexe, |
| stdout_golden = env.File('testdata/hello_world.stdout'), |
| stderr_golden = env.File('testdata/non_dfa_validator_hello.stderr'), |
| filter_regex = '"^(Hello, World!)$' + '|' + |
| @@ -845,7 +846,6 @@ if env.Bit('target_mips32'): |
| # Use arbitrary non-page-aligned addresses for data and rodata. |
| rodata_region_start = 0x10020094 |
| data_region_start = 0x10030098 |
| - untrusted_env = env.MakeUntrustedNativeEnv() |
|
Mark Seaborn
2013/10/15 23:38:45
Better to leave this in. Otherwise you're relying
petarj
2013/10/16 23:36:08
untrusted_env is not assigned under condition anym
|
| untrusted_env.Append(CPPFLAGS=['--pnacl-allow-native', '-arch', 'mips32']) |
| unaligned_data_objs = untrusted_env.ComponentObject( |
| 'arch/mips/unaligned_data_test.S') |
| @@ -887,6 +887,20 @@ node = env.CommandSelLdrTestNacl( |
| env.AddNodeToTestSuite(node, ['small_tests'], 'run_unaligned_data_irt_test') |
| # ---------------------------------------------------------- |
| +# Small tests with canned binaries |
| +# ---------------------------------------------------------- |
| + |
| +if env.Bit('target_x86_64'): |
| + node = env.CommandSelLdrTestNacl( |
|
Mark Seaborn
2013/10/15 23:38:45
Why is this moved?
petarj
2013/10/16 00:24:37
It is not this part that was moved, but the other
|
| + 'hello_x32.out', |
| + env.File(os.path.join(arch_testdata_dir, 'hello_x32.nexe')), |
| + stdout_golden=env.File(os.path.join('${MAIN_DIR}', |
| + 'tests/hello_world', |
| + 'hello_world.stdout')) |
| + ) |
| + env.AddNodeToTestSuite(node, ['small_tests'], 'run_hello_x32_test') |
| + |
| +# ---------------------------------------------------------- |
| # Integration Tests With Canned x86 Binaries |
| # ---------------------------------------------------------- |
| # To update the canned tests run: |
| @@ -919,13 +933,13 @@ def AddIntegrationTest(test, location): |
| ['medium_tests'], |
| 'run_%s_integration_test' % test) |
| -if env.Bit('target_x86'): |
| +if env.Bit('target_x86') and not env.Bit('bitcode'): |
| RE_HELLO = '^(Hello, World!)$' |
| RE_IDENT = '^\[[0-9,:.]*\] (e_ident\+1 = ELF)$' |
| - node = env.CommandSelLdrTestNacl( |
| + node = untrusted_env.CommandSelLdrTestNacl( |
| 'nacl_log.out', |
| - env.File(arch_testdata_dir + '/hello_world.nexe'), |
| + hello_world_nexe, |
| log_golden = env.File('testdata/hello_world.log'), |
| stdout_golden = env.File('testdata/hello_world.stdout'), |
| filter_regex = '"' + RE_HELLO + '|' + RE_IDENT + '"', |