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..20e604d6e38889c2ba143ce18d94873efd8f39bf 100644 |
| --- a/src/trusted/service_runtime/build.scons |
| +++ b/src/trusted/service_runtime/build.scons |
| @@ -554,10 +554,13 @@ elif env.Bit('target_x86_64'): |
| else: |
| arch_testdata_dir = 'testdata/' + env['TARGET_ARCHITECTURE'] |
| +untrusted_env = env.MakeUntrustedNativeEnv() |
| +hello_world_nexe = untrusted_env.File('$STAGING_DIR/hello_world.nexe') |
|
Mark Seaborn
2013/10/17 00:06:40
Can you use $PROGSUFFIX instead of .nexe to match
petarj
2013/10/17 18:52:49
Using $PROGSUFFIX causes a conflict for bitcode=1
|
| # 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('nacl_glibc')): |
|
Mark Seaborn
2013/10/17 00:06:40
Make this "env.Bit('nacl_static_link')" (no "not")
petarj
2013/10/17 18:52:49
Done.
|
| # NOTE: uses validator |
| mmap_test_objs = [env.ComponentObject('mmap_test.c')] |
| mmap_test_exe = env.ComponentProgram( |
| @@ -580,8 +583,7 @@ 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]) |
| + mmap_test_command = env.AddBootstrap(mmap_test_exe, [hello_world_nexe]) |
| # TODO(robertm): This test emits lots of messages to stderr |
| node = env.CommandTest ( |
| @@ -800,37 +802,21 @@ 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) |
| +nullptr_nexe = untrusted_env.GetTranslatedNexe( |
| + untrusted_env.File('$STAGING_DIR/nullptr$PROGSUFFIX')) |
| - node = env.CommandSelLdrTestNacl( |
| - 'fuzz_nullptr_test.out', |
| - nullptr_nexe, |
| - 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( |
| + 'fuzz_nullptr_test.out', |
| + nullptr_nexe, |
| + sel_ldr_flags=['-F']) |
| +env.AddNodeToTestSuite(node, ['small_tests'], 'run_fuzz_nullptr_test') |
| + |
| +# 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('nacl_glibc')): |
|
Mark Seaborn
2013/10/17 00:06:40
Not sure why this wouldn't work with dynamic linki
petarj
2013/10/17 18:52:49
untrusted_env has an issue with bitcode=1 while ca
|
| node = 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 +831,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() |
| untrusted_env.Append(CPPFLAGS=['--pnacl-allow-native', '-arch', 'mips32']) |
| unaligned_data_objs = untrusted_env.ComponentObject( |
| 'arch/mips/unaligned_data_test.S') |
| @@ -887,6 +872,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( |
| + '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 +918,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('nacl_glibc'): |
|
Mark Seaborn
2013/10/17 00:06:40
Same here.
|
| RE_HELLO = '^(Hello, World!)$' |
| RE_IDENT = '^\[[0-9,:.]*\] (e_ident\+1 = ELF)$' |
| node = 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 + '"', |