Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / native_client / tests / irt_compatibility / nacl.scons
1 # -*- python -*-
2 # Copyright (c) 2013 The Native Client Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 Import('env')
7
8 # IRT backward compatibility test
9
10 # This test uses a nexe built by another test.  Nexes do not get
11 # staged in pexe mode, so only run this test in nonpexe mode.
12 if env.Bit('pnacl_generate_pexe'):
13   Return()
14
15 blob_env = env['NACL_IRT_ENV'].Clone()
16 blob_env.Append(LINKFLAGS=['-Wl,-Trodata-segment=${IRT_BLOB_DATA_START}',
17                            '-Wl,-Ttext-segment=${IRT_BLOB_CODE_START}'])
18
19 # Build custom IRT library which provides a minimal subset of old
20 # interface versions.
21 blob_env.Append(CPPDEFINES=[['ALLOW_DYNAMIC_LINKING',
22                              str(int(not env.Bit('nacl_static_link')))]])
23 irt_comp_test_raw_library = blob_env.ComponentProgram(
24     'irt_comp_test_raw', ['irt_comp_interfaces.c'],
25     EXTRA_LIBS=['irt_support_private'])
26
27 irt_comp_test_library = env.ApplyTLSEdit(
28     'irt_comp_test',
29     irt_comp_test_raw_library)
30
31 # Don't provide IRT, we provide it ourselves via -B.
32 env.ClearBits('tests_use_irt')
33
34 node = env.CommandSelLdrTestNacl(
35     'irt_compatibility_test.out',
36     env.File('${STAGING_DIR}/hello_world.nexe'),
37     sel_ldr_flags=['-B', irt_comp_test_library],
38     stdout_golden=env.File('../hello_world/hello_world.stdout'))
39
40 env.AddNodeToTestSuite(node, ['small_tests'], 'run_irt_compatibility_test')