OLD | NEW |
| (Empty) |
1 # -*- python -*- | |
2 # Copyright (c) 2011 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 # TODO(robertm): explore if/why this overly restrictive guard is necessary | |
9 if env.Bit('bitcode'): | |
10 Return() | |
11 | |
12 if not env.Bit('build_x86_32'): | |
13 Return() | |
14 | |
15 srpc_libs = ['srpc', 'platform', 'gio', 'pthread', 'imc', 'imc_syscalls'] | |
16 env.Replace( | |
17 # Ensure that these compilations use only SDK include files. | |
18 CPPPATH=[], | |
19 # Ensure that these compilations use only SDK include libraries, etc. | |
20 # Only 32 bit libraries are supported by this test. | |
21 LINKFLAGS=['-m32'], | |
22 ) | |
23 | |
24 # Check that all the libraries were installed, a simple test builds and links. | |
25 env.ComponentProgram('libs_present_test.nexe', | |
26 ['libs_present_test.cc', | |
27 'libs_present_stub.cc'], | |
28 # This list should include all the libraries published | |
29 # into the SDK. | |
30 LIBS=srpc_libs + ['c', 'm', 'nacl', 'nosys']) | |
31 | |
32 # Check that GDB can print backtrace. | |
33 env.ComponentProgram('hello_world_gdb.nexe', | |
34 'hello_world_gdb.c') | |
35 | |
36 gdb_test = env.CommandGdbTestNacl( | |
37 'hello_world_gdb.out', | |
38 command=[env.File('hello_world_gdb.nexe')], | |
39 stdout_golden=env.File('hello_world_gdb.stdout'), | |
40 input=env.File('hello_world_gdb.in'), | |
41 filter_regex=("\"^(Breakpoint 1 at)|" | |
42 "^(Breakpoint 1, )0x[0-9a-fA-F]+ (in hello_world)|" | |
43 "^(#0 ) 0x[0-9a-fA-F]+ (in hello_world)|" | |
44 "^(#1 ) 0x[0-9a-fA-F]+ (in main)\"" | |
45 ), | |
46 filter_group_only='true', | |
47 ) | |
48 | |
49 # Currently gdb only works on Linux | |
50 if env.Bit('host_linux'): | |
51 # TODO(ncbray) enable this test or completely remove it. | |
52 # http://code.google.com/p/nativeclient/issues/detail?id=1180 | |
53 env.AddNodeToTestSuite(['hello_world_gdb.nexe', gdb_test], | |
54 ['medium_tests'], 'gdb_minimal_test', is_broken=True) | |
55 | |
56 | |
57 # TODO(mseaborn): explain this magic | |
58 if 'TRUSTED_ENV' in env: | |
59 env2 = env.Clone() | |
60 env2.PrependENVPath('PATH', env['TRUSTED_ENV'].SubstList2('${STAGING_DIR}')) | |
61 toolchain_tests = [ | |
62 env2.Command( | |
63 'test_toolchain', | |
64 ['${SCONSTRUCT_DIR}/tools/tests/test_toolchain.py', | |
65 env['TRUSTED_ENV'].SubstList2('${STAGING_DIR}/ncval${PROGSUFFIX}')], | |
66 '$PYTHON ${SOURCES[0].abspath}')] | |
67 | |
68 else: | |
69 print ('WARNING: no trusted env specified so skipping toolchain test. ' | |
70 'Try, e.g. MODE=dbg-host,nacl') | |
71 toolchain_tests = [] | |
72 | |
73 # If we aren't running on a tester (built_elsewhere), | |
74 # try to use the toolchain. | |
75 if not env.Bit('built_elsewhere'): | |
76 # Eventually we may want more SDK tests. | |
77 # NOTE this test is explicitly run by the toolchain makefile in a case | |
78 # where toolchain_tests is empty. Do not assume the lack of dependencies | |
79 # means the test is disabled. | |
80 # NOTE this test is effectively a no-op when TRUSTED_ENV is not present and | |
81 # libs_present_test.nexe has already been built. If libs_present.nexe has not | |
82 # been built, this will force it to be built during testing. | |
83 env.AddNodeToTestSuite(['libs_present_test.nexe', toolchain_tests], | |
84 ['small_tests'], 'sdk_minimal_test') | |
OLD | NEW |