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 if 'TRUSTED_ENV' not in env: | |
9 Return() | |
10 | |
11 if env.Bit('target_arm'): | |
12 # The test fails in our ARM cross-compile/QEMU environment, but only | |
13 # because the environment lacks libraries, which causes the dlopen() | |
14 # to fail. | |
15 Return() | |
16 | |
17 trusted_env = env['TRUSTED_ENV'].Clone() | |
18 | |
19 if trusted_env.Bit('coverage_enabled') and trusted_env.Bit('windows'): | |
20 # Disable the coverage test on Windows. This is related to bug: | |
21 # http://code.google.com/p/nativeclient/issues/detail?id=1030 | |
22 # TODO(dspringer): re-enable this test once the bug is fixed. | |
23 Return() | |
24 | |
25 if not trusted_env.Bit('mac'): | |
26 trusted_env['COMPONENT_STATIC'] = False | |
27 | |
28 | |
29 if trusted_env.Bit('linux'): | |
30 trusted_env.Append( | |
31 CCFLAGS=['-fPIC', '-Wno-long-long',], | |
32 # Catch unresolved symbols in libraries. | |
33 LINKFLAGS=['-Wl,-z,defs'], | |
34 ) | |
35 | |
36 # We usually try to build things statically, but the plugin is a .so | |
37 trusted_env.FilterOut(LINKFLAGS=['-static']) | |
38 trusted_env.Append(LIBS=['dl', 'pthread']) | |
39 | |
40 if trusted_env.Bit('windows'): | |
41 trusted_env.Append( | |
42 CPPDEFINES = ['WIN32', '_WINDOWS'], | |
43 ) | |
44 | |
45 | |
46 trusted_env.Append(LIBS=['ppapi_browser', 'ppapi_plugin', 'platform', 'gio']) | |
47 | |
48 fake_browser = trusted_env.ComponentProgram('fake_browser_ppapi', | |
49 ['fake_core.cc', | |
50 'fake_file_io.cc', | |
51 'fake_file_io_trusted.cc', | |
52 'fake_file_ref.cc', | |
53 'fake_host.cc', | |
54 'fake_instance.cc', | |
55 'fake_nacl_private.cc', | |
56 'fake_object.cc', | |
57 'fake_resource.cc', | |
58 'fake_url_loader.cc', | |
59 'fake_url_request_info.cc', | |
60 'fake_url_response_info.cc', | |
61 'fake_url_util.cc', | |
62 'fake_window.cc', | |
63 'main.cc', | |
64 'test_scriptable.cc', | |
65 'utility.cc']) | |
66 | |
67 target_nmf = 'basic_object.nmf'; | |
68 basic_object_nmf = env.File('${STAGING_DIR}/' + target_nmf) | |
69 | |
70 basic_object_target = env.File( | |
71 '$STAGING_DIR/ppapi_basic_object_${TARGET_FULLARCH}${PROGSUFFIX}') | |
72 | |
73 if trusted_env.Bit('mac'): | |
74 plugin = trusted_env.File('${STAGING_DIR}/ppNaClPlugin') | |
75 else: | |
76 plugin = trusted_env.File('${STAGING_DIR}/${SHLIBPREFIX}' | |
77 'ppNaClPlugin${SHLIBSUFFIX}') | |
78 sel_ldr = trusted_env.File('${STAGING_DIR}/${PROGPREFIX}sel_ldr${PROGSUFFIX}') | |
79 log_file = env.MakeNaClLogOption('fake_browser_ppapi.out') | |
80 | |
81 test_env_vars = ['NACL_SEL_LDR=%s' % sel_ldr, | |
82 'NACLLOG=%s' % log_file] | |
83 if env.Bit('irt'): | |
84 test_env_vars.append('NACL_IRT_LIBRARY=%s' % env.GetIrtNexe()) | |
85 | |
86 node = env.CommandTest('fake_browser_ppapi.out', | |
87 [fake_browser, | |
88 plugin, | |
89 'http://localhost:5103/basic_object.html', | |
90 # Must use relative nexe url for the test to work. | |
91 # See TODO in URLLoader::FinishStreamingToFile(). | |
92 '"id=nacl_module;src=%s"' % target_nmf, | |
93 '${STAGING_DIR}' | |
94 ], | |
95 'medium', | |
96 osenv=test_env_vars, | |
97 extra_deps=[sel_ldr, | |
98 basic_object_nmf, | |
99 basic_object_target]) | |
100 | |
101 env.AddNodeToTestSuite(node, ['medium_tests'], 'run_fake_browser_ppapi_test') | |
OLD | NEW |