Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / chrome / test / data / nacl / nacl_test_data.gyp
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 {
6   'includes': [
7     '../../../../ppapi/ppapi_nacl_test_common.gypi',
8   ],
9   'targets': [
10     {
11       'target_name': 'shared_test_files',
12       'type': 'none',
13       'variables': {
14         'build_newlib': 1,
15         'build_glibc': 1,
16         'build_pnacl_newlib': 1,
17         'nexe_destination_dir': 'nacl_test_data',
18         'test_files': [
19           # TODO(ncbray) move into chrome/test/data/nacl when all tests are
20           # converted.
21           '<(DEPTH)/ppapi/native_client/tests/ppapi_browser/progress_event_listener.js',
22           '<(DEPTH)/ppapi/native_client/tools/browser_tester/browserdata/nacltest.js',
23
24           # Files that aren't assosiated with any particular executable.
25           'bad/ppapi_bad.html',
26           'bad/ppapi_bad.js',
27           'bad/ppapi_bad_native.html',
28           'bad/ppapi_bad_doesnotexist.nmf',
29           'bad/ppapi_bad_magic.nmf',
30           'bad/ppapi_bad_manifest_uses_nexes.nmf',
31           'bad/ppapi_bad_manifest_bad_files.nmf',
32           'bad/ppapi_bad_manifest_nexe_arch.nmf',
33           'crash/ppapi_crash.html',
34           'load_util.js',
35           'manifest_file/test_file.txt',
36         ],
37       },
38       'conditions': [
39         ['target_arch=="ia32" and OS=="linux"', {
40           # Enable nonsfi testing only on ia32-linux environment.
41           # This flag causes test_files to be copied into nonsfi directory,
42           # too.
43           'variables': {
44             'enable_x86_32_nonsfi': 1,
45           },
46         }],
47       ],
48     },
49     {
50       'target_name': 'simple_test',
51       'type': 'none',
52       'variables': {
53         'nexe_target': 'simple',
54         'build_newlib': 1,
55         'build_glibc': 1,
56         'build_pnacl_newlib': 1,
57         'nexe_destination_dir': 'nacl_test_data',
58         'sources': [
59           'simple.cc',
60         ],
61         'test_files': [
62           'nacl_load_test.html',
63         ],
64       },
65     },
66     {
67       'target_name': 'exit_status_test',
68       'type': 'none',
69       'variables': {
70         'nexe_target': 'pm_exit_status_test',
71         'build_newlib': 1,
72         'build_glibc': 1,
73         'build_pnacl_newlib': 1,
74         'nexe_destination_dir': 'nacl_test_data',
75         'sources': [
76           'exit_status/pm_exit_status_test.cc',
77         ],
78         'test_files': [
79           'exit_status/pm_exit_status_test.html',
80         ],
81       },
82     },
83     {
84       'target_name': 'extension_validation_cache',
85       'type': 'none',
86       'variables': {
87         'nexe_target': 'extension_validation_cache',
88         # The test currently only has the test expectations for the
89         # newlib and glibc cases (# validation queries/settings), and has also
90         # hardcoded the newlib and glibc variants' directory path for the
91         # unpacked ext.
92         'build_newlib': 1,
93         'build_glibc': 1,
94         'build_pnacl_newlib': 0,
95         # Need a new directory to not clash with with other extension
96         # tests's files (e.g., manifest.json).
97         'nexe_destination_dir': 'nacl_test_data/extension_vcache_test',
98         'sources': [
99           'simple.cc',
100         ],
101         'test_files': [
102           # TODO(ncbray) move into chrome/test/data/nacl when all tests are
103           # converted.
104           '<(DEPTH)/ppapi/native_client/tools/browser_tester/browserdata/nacltest.js',
105           'extension_validation_cache/extension_validation_cache.html',
106           'extension_validation_cache/extension_validation_cache.js',
107           # Turns the test data directory into an extension.
108           # Use a different nexe_destination_dir to isolate the files.
109           # Note that the .nexe names are embedded in this file.
110           'extension_validation_cache/manifest.json',
111           'load_util.js',
112         ],
113       },
114       'dependencies': [
115         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
116       ],
117     },
118     {
119       'target_name': 'sysconf_nprocessors_onln_test',
120       'type': 'none',
121       'variables': {
122         'nexe_target': 'sysconf_nprocessors_onln_test',
123         'build_newlib': 1,
124         'build_glibc': 1,
125         'build_pnacl_newlib': 1,
126         'nexe_destination_dir': 'nacl_test_data',
127         'sources': [
128           'sysconf_nprocessors_onln/sysconf_nprocessors_onln_test.cc',
129         ],
130         'test_files': [
131           'sysconf_nprocessors_onln/sysconf_nprocessors_onln_test.html',
132         ],
133       },
134     },
135     {
136       'target_name': 'ppapi_test_lib',
137       'type': 'none',
138       'variables': {
139         'nlib_target': 'libppapi_test_lib.a',
140         'nso_target': 'libppapi_test_lib.so',
141         'build_newlib': 1,
142         'build_glibc': 1,
143         'build_pnacl_newlib': 1,
144         'nexe_destination_dir': 'nacl_test_data',
145         'sources': [
146           # TODO(ncbray) move these files once SCons no longer depends on them.
147           '../../../../ppapi/native_client/tests/ppapi_test_lib/get_browser_interface.cc',
148           '../../../../ppapi/native_client/tests/ppapi_test_lib/internal_utils.cc',
149           '../../../../ppapi/native_client/tests/ppapi_test_lib/module_instance.cc',
150           '../../../../ppapi/native_client/tests/ppapi_test_lib/testable_callback.cc',
151           '../../../../ppapi/native_client/tests/ppapi_test_lib/test_interface.cc',
152         ]
153       },
154       'dependencies': [
155         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
156       ],
157     },
158     {
159       'target_name': 'nacl_ppapi_util',
160       'type': 'none',
161       'variables': {
162         'nlib_target': 'libnacl_ppapi_util.a',
163         'nso_target': 'libnacl_ppapi_util.so',
164         'build_newlib': 1,
165         'build_glibc': 1,
166         'build_pnacl_newlib': 1,
167         'nexe_destination_dir': 'nacl_test_data',
168         'sources': [
169           # TODO(ncbray) move these files once SCons no longer depends on them.
170           '../../../../ppapi/native_client/src/untrusted/nacl_ppapi_util/string_buffer.cc',
171           '../../../../ppapi/native_client/src/untrusted/nacl_ppapi_util/nacl_ppapi_util.cc',
172           '../../../../ppapi/native_client/src/untrusted/nacl_ppapi_util/ppapi_srpc_main.c',
173         ]
174       },
175       'dependencies': [
176         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
177       ],
178     },
179     {
180       'target_name': 'ppapi_progress_events',
181       'type': 'none',
182       'variables': {
183         'nexe_target': 'ppapi_progress_events',
184         'build_newlib': 1,
185         'build_glibc': 1,
186         'build_pnacl_newlib': 1,
187         'nexe_destination_dir': 'nacl_test_data',
188         'link_flags': [
189           '-lppapi',
190           '-lppapi_test_lib',
191           '-lplatform',
192           '-lgio',
193         ],
194         'sources': [
195           'progress_events/ppapi_progress_events.cc',
196         ],
197         'test_files': [
198           'progress_events/ppapi_progress_events.html',
199         ],
200       },
201       'dependencies': [
202         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
203         '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform_lib',
204         '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio_lib',
205         '<(DEPTH)/ppapi/native_client/native_client.gyp:ppapi_lib',
206         '<(DEPTH)/ppapi/ppapi_nacl.gyp:ppapi_cpp_lib',
207         'ppapi_test_lib',
208       ],
209     },
210     {
211       'target_name': 'ppapi_bad_ppp_initialize',
212       'type': 'none',
213       'variables': {
214         'nexe_target': 'ppapi_bad_ppp_initialize',
215         'build_newlib': 1,
216         'build_glibc': 0,
217         'build_pnacl_newlib': 0,
218         'nexe_destination_dir': 'nacl_test_data',
219         'link_flags': [
220           '-lppapi',
221           '-lplatform',
222           '-lgio',
223         ],
224         'sources': [
225           'bad/ppapi_bad_ppp_initialize.cc',
226         ],
227       },
228       'dependencies': [
229         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
230         '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform_lib',
231         '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio_lib',
232         '<(DEPTH)/ppapi/native_client/native_client.gyp:ppapi_lib',
233       ],
234     },
235     {
236       'target_name': 'ppapi_bad_ppp_initialize_crash',
237       'type': 'none',
238       'variables': {
239         'nexe_target': 'ppapi_bad_ppp_initialize_crash',
240         'build_newlib': 1,
241         'build_glibc': 0,
242         'build_pnacl_newlib': 0,
243         'nexe_destination_dir': 'nacl_test_data',
244         'link_flags': [
245           '-lppapi',
246           '-lplatform',
247           '-lgio',
248         ],
249         'sources': [
250           'bad/ppapi_bad_ppp_initialize_crash.cc',
251         ],
252       },
253       'dependencies': [
254         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
255         '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform_lib',
256         '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio_lib',
257         '<(DEPTH)/ppapi/native_client/native_client.gyp:ppapi_lib',
258       ],
259     },
260     {
261       'target_name': 'ppapi_bad_no_ppp_instance',
262       'type': 'none',
263       'variables': {
264         'nexe_target': 'ppapi_bad_no_ppp_instance',
265         'build_newlib': 1,
266         'build_glibc': 0,
267         'build_pnacl_newlib': 0,
268         'nexe_destination_dir': 'nacl_test_data',
269         'link_flags': [
270           '-lppapi',
271           '-lplatform',
272           '-lgio',
273         ],
274         'sources': [
275           'bad/ppapi_bad_no_ppp_instance.cc',
276         ],
277       },
278       'dependencies': [
279         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
280         '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform_lib',
281         '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio_lib',
282         '<(DEPTH)/ppapi/native_client/native_client.gyp:ppapi_lib',
283       ],
284     },
285     {
286       'target_name': 'ppapi_bad_get_ppp_instance_crash',
287       'type': 'none',
288       'variables': {
289         'nexe_target': 'ppapi_bad_get_ppp_instance_crash',
290         'build_newlib': 1,
291         'build_glibc': 0,
292         'build_pnacl_newlib': 0,
293         'nexe_destination_dir': 'nacl_test_data',
294         'link_flags': [
295           '-lppapi',
296           '-lplatform',
297           '-lgio',
298         ],
299         'sources': [
300           'bad/ppapi_bad_get_ppp_instance_crash.cc',
301         ],
302       },
303       'dependencies': [
304         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
305         '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform_lib',
306         '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio_lib',
307         '<(DEPTH)/ppapi/native_client/native_client.gyp:ppapi_lib',
308       ],
309     },
310     {
311       'target_name': 'ppapi_bad_ppp_instance_didcreate',
312       'type': 'none',
313       'variables': {
314         'nexe_target': 'ppapi_bad_ppp_instance_didcreate',
315         'build_newlib': 1,
316         'build_glibc': 0,
317         'build_pnacl_newlib': 0,
318         'nexe_destination_dir': 'nacl_test_data',
319         'link_flags': [
320           '-lppapi',
321           '-lplatform',
322           '-lgio',
323         ],
324         'sources': [
325           'bad/ppapi_bad_ppp_instance_didcreate.cc',
326         ],
327       },
328       'dependencies': [
329         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
330         '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform_lib',
331         '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio_lib',
332         '<(DEPTH)/ppapi/native_client/native_client.gyp:ppapi_lib',
333       ],
334     },
335     {
336       'target_name': 'ppapi_bad_ppp_instance_didcreate_crash',
337       'type': 'none',
338       'variables': {
339         'nexe_target': 'ppapi_bad_ppp_instance_didcreate_crash',
340         'build_newlib': 1,
341         'build_glibc': 0,
342         'build_pnacl_newlib': 0,
343         'nexe_destination_dir': 'nacl_test_data',
344         'link_flags': [
345           '-lppapi',
346           '-lplatform',
347           '-lgio',
348         ],
349         'sources': [
350           'bad/ppapi_bad_ppp_instance_didcreate_crash.cc',
351         ],
352       },
353       'dependencies': [
354         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
355         '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform_lib',
356         '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio_lib',
357         '<(DEPTH)/ppapi/native_client/native_client.gyp:ppapi_lib',
358       ],
359     },
360     {
361       'target_name': 'ppapi_crash_via_check_failure',
362       'type': 'none',
363       'variables': {
364         'nexe_target': 'ppapi_crash_via_check_failure',
365         'build_newlib': 1,
366         'build_glibc': 1,
367         'build_pnacl_newlib': 1,
368         'nexe_destination_dir': 'nacl_test_data',
369         'link_flags': [
370           '-lppapi',
371           '-lppapi_test_lib',
372           '-lplatform',
373           '-lgio',
374         ],
375         'sources': [
376           'crash/ppapi_crash_via_check_failure.cc',
377         ],
378       },
379       'dependencies': [
380         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
381         '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform_lib',
382         '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio_lib',
383         '<(DEPTH)/ppapi/native_client/native_client.gyp:ppapi_lib',
384         '<(DEPTH)/ppapi/ppapi_nacl.gyp:ppapi_cpp_lib',
385         'ppapi_test_lib',
386       ],
387     },
388     {
389       'target_name': 'ppapi_crash_via_exit_call',
390       'type': 'none',
391       'variables': {
392         'nexe_target': 'ppapi_crash_via_exit_call',
393         'build_newlib': 1,
394         'build_glibc': 1,
395         'build_pnacl_newlib': 1,
396         'nexe_destination_dir': 'nacl_test_data',
397         'link_flags': [
398           '-lppapi',
399           '-lppapi_test_lib',
400           '-lplatform',
401           '-lgio',
402         ],
403         'sources': [
404           'crash/ppapi_crash_via_exit_call.cc',
405         ],
406       },
407       'dependencies': [
408         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
409         '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform_lib',
410         '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio_lib',
411         '<(DEPTH)/ppapi/native_client/native_client.gyp:ppapi_lib',
412         '<(DEPTH)/ppapi/ppapi_nacl.gyp:ppapi_cpp_lib',
413         'ppapi_test_lib',
414       ],
415     },
416     {
417       'target_name': 'ppapi_crash_in_callback',
418       'type': 'none',
419       'variables': {
420         'nexe_target': 'ppapi_crash_in_callback',
421         'build_newlib': 1,
422         'build_glibc': 1,
423         'build_pnacl_newlib': 1,
424         'nexe_destination_dir': 'nacl_test_data',
425         'link_flags': [
426           '-lppapi',
427           '-lppapi_test_lib',
428           '-lplatform',
429           '-lgio',
430         ],
431         'sources': [
432           'crash/ppapi_crash_in_callback.cc',
433         ],
434       },
435       'dependencies': [
436         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
437         '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform_lib',
438         '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio_lib',
439         '<(DEPTH)/ppapi/native_client/native_client.gyp:ppapi_lib',
440         '<(DEPTH)/ppapi/ppapi_nacl.gyp:ppapi_cpp_lib',
441         'ppapi_test_lib',
442       ],
443     },
444     {
445       'target_name': 'ppapi_crash_off_main_thread',
446       'type': 'none',
447       'variables': {
448         'nexe_target': 'ppapi_crash_off_main_thread',
449         'build_newlib': 1,
450         'build_glibc': 1,
451         'build_pnacl_newlib': 1,
452         'nexe_destination_dir': 'nacl_test_data',
453         'link_flags': [
454           '-lppapi',
455           '-lppapi_test_lib',
456           '-lplatform',
457           '-lgio',
458         ],
459         'sources': [
460           'crash/ppapi_crash_off_main_thread.cc',
461         ],
462       },
463       'dependencies': [
464         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
465         '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform_lib',
466         '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio_lib',
467         '<(DEPTH)/ppapi/native_client/native_client.gyp:ppapi_lib',
468         '<(DEPTH)/ppapi/ppapi_nacl.gyp:ppapi_cpp_lib',
469         'ppapi_test_lib',
470       ],
471     },
472     {
473       'target_name': 'ppapi_crash_ppapi_off_main_thread',
474       'type': 'none',
475       'variables': {
476         'nexe_target': 'ppapi_crash_ppapi_off_main_thread',
477         'build_newlib': 1,
478         'build_glibc': 1,
479         'build_pnacl_newlib': 1,
480         'nexe_destination_dir': 'nacl_test_data',
481         'link_flags': [
482           '-lppapi',
483           '-lppapi_test_lib',
484           '-lplatform',
485           '-lgio',
486         ],
487         'sources': [
488           'crash/ppapi_crash_ppapi_off_main_thread.cc',
489         ],
490       },
491       'dependencies': [
492         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
493         '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform_lib',
494         '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio_lib',
495         '<(DEPTH)/ppapi/native_client/native_client.gyp:ppapi_lib',
496         '<(DEPTH)/ppapi/ppapi_nacl.gyp:ppapi_cpp_lib',
497         'ppapi_test_lib',
498       ],
499     },
500     {
501       'target_name': 'pm_redir_test',
502       'type': 'none',
503       'variables': {
504         'nexe_target': 'pm_redir_test',
505         'build_newlib': 1,
506         'build_glibc': 1,
507         'build_pnacl_newlib': 1,
508         'nexe_destination_dir': 'nacl_test_data',
509         'link_flags': [
510           '-lppapi',
511           '-lplatform',
512           '-lgio',
513         ],
514         'sources': [
515           'postmessage_redir/pm_redir_test.cc',
516         ],
517         'test_files': [
518           'postmessage_redir/pm_redir_test.html',
519         ],
520       },
521       'dependencies': [
522         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
523         '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform_lib',
524         '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio_lib',
525         '<(DEPTH)/ppapi/native_client/native_client.gyp:ppapi_lib',
526         '<(DEPTH)/ppapi/ppapi_nacl.gyp:ppapi_cpp_lib',
527       ],
528     },
529     {
530       'target_name': 'pm_manifest_file',
531       'type': 'none',
532       'variables': {
533         'nexe_target': 'pm_manifest_file',
534         'build_newlib': 1,
535         'build_glibc': 1,
536         # TODO(ncbray) support file injection into PNaCl manifest.
537         'build_pnacl_newlib': 0,
538         'nexe_destination_dir': 'nacl_test_data',
539         'link_flags': [
540           '-lnacl_ppapi_util',
541           '-lppapi_cpp',
542           '-lppapi',
543           '-lsrpc',
544           '-lplatform',
545           '-lgio',
546           '-limc',
547           '-limc_syscalls',
548           '-lweak_ref',
549         ],
550         'sources': [
551           'manifest_file/pm_manifest_file_test.cc',
552         ],
553         'create_nmf_args_portable': [
554           '-xtest_file:test_file.txt',
555           '-xnmf says hello world:test_file.txt',
556         ],
557         'test_files': [
558           'manifest_file/pm_manifest_file_test.html',
559         ],
560       },
561       'dependencies': [
562         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
563         '<(DEPTH)/ppapi/ppapi_nacl.gyp:ppapi_cpp_lib',
564         '<(DEPTH)/ppapi/native_client/native_client.gyp:ppapi_lib',
565         '<(DEPTH)/native_client/src/shared/srpc/srpc.gyp:srpc_lib',
566         '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform_lib',
567         '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio_lib',
568         '<(DEPTH)/native_client/src/shared/imc/imc.gyp:imc_lib',
569         '<(DEPTH)/native_client/src/untrusted/nacl/nacl.gyp:imc_syscalls_lib',
570         '<(DEPTH)/native_client/src/trusted/weak_ref/weak_ref.gyp:weak_ref_lib',
571         'nacl_ppapi_util',
572       ],
573     },
574     {
575       'target_name': 'pm_pre_init_manifest_file',
576       'type': 'none',
577       'variables': {
578         'nexe_target': 'pm_pre_init_manifest_file',
579         'build_newlib': 1,
580         'build_glibc': 1,
581         # TODO(ncbray) support file injection into PNaCl manifest.
582         'build_pnacl_newlib': 0,
583         'nexe_destination_dir': 'nacl_test_data',
584         'link_flags': [
585           '-lnacl_ppapi_util',
586           '-lppapi_cpp',
587           '-lppapi',
588           '-lsrpc',
589           '-lplatform',
590           '-lgio',
591           '-limc',
592           '-limc_syscalls',
593           '-lweak_ref',
594         ],
595         'sources': [
596           'manifest_file/pm_pre_init_manifest_file_test.cc',
597         ],
598         'create_nmf_args_portable': [
599           '-xtest_file:test_file.txt',
600           '-xnmf says hello world:test_file.txt',
601         ],
602         'test_files': [
603           'manifest_file/pm_pre_init_manifest_file_test.html',
604         ],
605       },
606       'dependencies': [
607         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
608         '<(DEPTH)/ppapi/ppapi_nacl.gyp:ppapi_cpp_lib',
609         '<(DEPTH)/ppapi/native_client/native_client.gyp:ppapi_lib',
610         '<(DEPTH)/native_client/src/shared/srpc/srpc.gyp:srpc_lib',
611         '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform_lib',
612         '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio_lib',
613         '<(DEPTH)/native_client/src/shared/imc/imc.gyp:imc_lib',
614         '<(DEPTH)/native_client/src/untrusted/nacl/nacl.gyp:imc_syscalls_lib',
615         '<(DEPTH)/native_client/src/trusted/weak_ref/weak_ref.gyp:weak_ref_lib',
616         'nacl_ppapi_util',
617       ],
618     },
619     {
620       'target_name': 'irt_manifest_file',
621       'type': 'none',
622       'variables': {
623         'nexe_target': 'irt_manifest_file',
624         'build_newlib': 1,
625         # Linking problems - can't find __nacl_irt_query.
626         'build_glibc': 0,
627         # TODO(ncbray) support file injection into PNaCl manifest.
628         'build_pnacl_newlib': 0,
629         'nexe_destination_dir': 'nacl_test_data',
630         'link_flags': [
631           '-lnacl_ppapi_util',
632           '-lppapi_cpp',
633           '-lppapi',
634           '-lsrpc',
635           '-lplatform',
636           '-lgio',
637           '-limc',
638           '-limc_syscalls',
639           '-lweak_ref',
640           '-lnacl',
641         ],
642         'sources': [
643           'manifest_file/irt_manifest_file_test.cc',
644         ],
645         'create_nmf_args_portable': [
646           '-xtest_file:test_file.txt',
647           '-xnmf says hello world:test_file.txt',
648           # There is no dummy_test_file.txt file intentionally. This is just for
649           # a test case where there is a manifest entry, but no actual file.
650           '-xdummy_test_file:dummy_test_file.txt',
651         ],
652         'test_files': [
653           'manifest_file/irt_manifest_file_test.html',
654         ],
655       },
656       'dependencies': [
657         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
658         '<(DEPTH)/ppapi/ppapi_nacl.gyp:ppapi_cpp_lib',
659         '<(DEPTH)/ppapi/native_client/native_client.gyp:ppapi_lib',
660         '<(DEPTH)/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_irt_shim.gyp:aot',
661         '<(DEPTH)/native_client/src/shared/srpc/srpc.gyp:srpc_lib',
662         '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform_lib',
663         '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio_lib',
664         '<(DEPTH)/native_client/src/shared/imc/imc.gyp:imc_lib',
665         '<(DEPTH)/native_client/src/untrusted/nacl/nacl.gyp:imc_syscalls_lib',
666         '<(DEPTH)/native_client/src/untrusted/nacl/nacl.gyp:nacl_lib',
667         '<(DEPTH)/native_client/src/trusted/weak_ref/weak_ref.gyp:weak_ref_lib',
668         'nacl_ppapi_util',
669       ],
670       'conditions': [
671         ['target_arch=="ia32" and OS=="linux"', {
672           # Enable nonsfi testing only on ia32-linux environment.
673           'variables': {
674             # This is needed to build a non-SFI nexe binary.
675             # Note that this triggers building nexe files for other
676             # architectures, such as x86-32 (based on enable_XXX variables).
677             # As described above, although the tests for pnacl are currently
678             # disabled, but building the binary should work.
679             # We cannot disable building, as enable_XXX variables are also used
680             # to build newlib linked nexes.
681             'build_pnacl_newlib': 1,
682             'translate_pexe_with_build': 1,
683             'enable_x86_32_nonsfi': 1,
684           },
685         }],
686       ],
687     },
688     {
689       'target_name': 'irt_exception_test',
690       'type': 'none',
691       'variables': {
692         'nexe_target': 'irt_exception_test',
693         'build_newlib': 1,
694         'generate_nmf': 1,
695         'nexe_destination_dir': 'nacl_test_data',
696         'build_pnacl_newlib': 1,
697         'link_flags': [
698           '-lppapi',
699           '-lppapi_test_lib',
700           '-lplatform',
701           '-lgio',
702           '-lnacl_exception',
703         ],
704         'sources': [
705           'irt_exception/irt_exception_test.cc',
706         ],
707         'test_files': [
708           # TODO(ncbray) move into chrome/test/data/nacl when all tests are
709           # converted.
710           'irt_exception/irt_exception_test.html',
711         ],
712       },
713       'dependencies': [
714         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
715         '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform_lib',
716         '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio_lib',
717         '<(DEPTH)/native_client/src/untrusted/nacl/nacl.gyp:nacl_exception_lib',
718         '<(DEPTH)/ppapi/native_client/native_client.gyp:ppapi_lib',
719         '<(DEPTH)/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_irt_shim.gyp:aot',
720         '<(DEPTH)/ppapi/ppapi_nacl.gyp:ppapi_cpp_lib',
721         'ppapi_test_lib',
722       ],
723       'conditions': [
724         ['target_arch=="ia32" and OS=="linux"', {
725           # Enable nonsfi testing only on ia32-linux environment.
726           'variables': {
727             'enable_x86_32_nonsfi': 1,
728             'translate_pexe_with_build': 1,
729           },
730         }],
731       ],
732     },
733     {
734       'target_name': 'pm_nameservice_test',
735       'type': 'none',
736       'variables': {
737         'nexe_target': 'pm_nameservice_test',
738         'build_newlib': 1,
739         'build_glibc': 1,
740         'build_pnacl_newlib': 1,
741         'nexe_destination_dir': 'nacl_test_data',
742         'link_flags': [
743           '-lnacl_ppapi_util',
744           '-lppapi_cpp',
745           '-lppapi',
746           '-lsrpc',
747           '-lplatform',
748           '-lgio',
749           '-limc',
750           '-limc_syscalls',
751           '-lweak_ref',
752         ],
753         'sources': [
754           'nameservice/pm_nameservice_test.cc',
755         ],
756         'test_files': [
757           'nameservice/pm_nameservice_test.html',
758         ],
759       },
760       'dependencies': [
761         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
762         '<(DEPTH)/ppapi/ppapi_nacl.gyp:ppapi_cpp_lib',
763         '<(DEPTH)/ppapi/native_client/native_client.gyp:ppapi_lib',
764         '<(DEPTH)/native_client/src/shared/srpc/srpc.gyp:srpc_lib',
765         '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform_lib',
766         '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio_lib',
767         '<(DEPTH)/native_client/src/shared/imc/imc.gyp:imc_lib',
768         '<(DEPTH)/native_client/src/untrusted/nacl/nacl.gyp:imc_syscalls_lib',
769         '<(DEPTH)/native_client/src/trusted/weak_ref/weak_ref.gyp:weak_ref_lib',
770         'nacl_ppapi_util',
771       ],
772     },
773     {
774       'target_name': 'ppapi_extension_mime_handler',
775       'type': 'none',
776       'variables': {
777         'nexe_target': 'ppapi_extension_mime_handler',
778         'build_newlib': 1,
779         'build_glibc': 0,
780         'build_pnacl_newlib': 0,
781         'nexe_destination_dir': 'nacl_test_data',
782         'link_flags': [
783           '-lppapi',
784           '-lppapi_test_lib',
785           '-lplatform',
786           '-lgio',
787         ],
788         'sources': [
789           'extension_mime_handler/ppapi_extension_mime_handler.cc',
790         ],
791         'test_files': [
792           'extension_mime_handler/ppapi_extension_mime_handler.html',
793           'extension_mime_handler/mime_test_data.dat',
794           # For faking the file's MIME type.
795           'extension_mime_handler/mime_test_data.dat.mock-http-headers',
796           # Turns the test data directory into an extension.  Hackish.
797           # Note that the .nexe names are embedded in this file.
798           'extension_mime_handler/manifest.json',
799         ],
800       },
801       'dependencies': [
802         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
803         '<(DEPTH)/ppapi/native_client/native_client.gyp:ppapi_lib',
804         '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform_lib',
805         '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio_lib',
806         'ppapi_test_lib',
807       ],
808     },
809     {
810       'target_name': 'pnacl_debug_url_test',
811       'type': 'none',
812       'variables': {
813         'nexe_target': 'pnacl_debug_url',
814         'build_pnacl_newlib': 1,
815         'nexe_destination_dir': 'nacl_test_data',
816         'generate_nmf': 0,
817         'sources': [
818           'simple.cc',
819         ],
820         'test_files': [
821           'pnacl_debug_url/pnacl_debug_url.html',
822           'pnacl_debug_url/pnacl_has_debug.nmf',
823           'pnacl_debug_url/pnacl_has_debug_flag_off.nmf',
824           'pnacl_debug_url/pnacl_no_debug.nmf',
825         ],
826       },
827       'dependencies': [
828         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
829       ]
830     },
831     {
832       'target_name': 'pnacl_error_handling_test',
833       'type': 'none',
834       'variables': {
835         'build_pnacl_newlib': 1,
836         'nexe_destination_dir': 'nacl_test_data',
837         # Use prebuilt NMF files.
838         'generate_nmf': 0,
839         'test_files': [
840           'pnacl_error_handling/pnacl_error_handling.html',
841           'pnacl_error_handling/bad.pexe',
842           'pnacl_error_handling/pnacl_bad_pexe.nmf',
843           'pnacl_error_handling/pnacl_bad_doesnotexist.nmf',
844           'pnacl_error_handling/pnacl_illformed_manifest.nmf',
845         ],
846       },
847       'dependencies': [
848         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
849       ]
850     },
851     {
852       'target_name': 'pnacl_mime_type_test',
853       'type': 'none',
854       'variables': {
855         'build_newlib': 1,
856         'build_glibc': 1,
857         'build_pnacl_newlib': 1,
858         'nexe_destination_dir': 'nacl_test_data',
859         'test_files': [
860           'pnacl_mime_type/pnacl_mime_type.html',
861         ],
862       },
863     },
864     {
865       'target_name': 'pnacl_options_test',
866       'type': 'none',
867       'variables': {
868         'nexe_target': 'pnacl_options',
869         'build_pnacl_newlib': 1,
870         'nexe_destination_dir': 'nacl_test_data',
871         'generate_nmf': 0,
872         'sources': [
873           'simple.cc',
874         ],
875         'test_files': [
876           'pnacl_nmf_options/pnacl_options.html',
877           'pnacl_nmf_options/pnacl_o_0.nmf',
878           'pnacl_nmf_options/pnacl_o_2.nmf',
879           'pnacl_nmf_options/pnacl_o_large.nmf',
880         ],
881       },
882       'dependencies': [
883         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
884       ]
885     },
886     {
887       'target_name': 'pnacl_dyncode_syscall_disabled_test',
888       'type': 'none',
889       'variables': {
890         'nexe_target': 'pnacl_dyncode_syscall_disabled',
891         'build_pnacl_newlib': 1,
892         'nexe_destination_dir': 'nacl_test_data',
893         'link_flags': [
894           '-lppapi',
895           '-lppapi_test_lib',
896           '-lplatform',
897           '-lgio',
898           # The "_private" variant of the library calls the syscalls
899           # directly, which allows us to test the syscalls directly,
900           # even when the dyncode IRT interface is also disabled under
901           # PNaCl.
902           '-lnacl_dyncode_private',
903         ],
904         'sources': [
905           'pnacl_dyncode_syscall_disabled/pnacl_dyncode_syscall_disabled.cc',
906         ],
907         'test_files': [
908           'pnacl_dyncode_syscall_disabled/pnacl_dyncode_syscall_disabled.html',
909         ],
910       },
911       'dependencies': [
912         '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio_lib',
913         '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform_lib',
914         '<(DEPTH)/native_client/src/untrusted/nacl/nacl.gyp:nacl_dyncode_private_lib',
915         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
916         '<(DEPTH)/ppapi/native_client/native_client.gyp:ppapi_lib',
917         '<(DEPTH)/ppapi/ppapi_nacl.gyp:ppapi_cpp_lib',
918         'ppapi_test_lib',
919       ],
920     },
921     {
922       'target_name': 'pnacl_hw_eh_disabled_test',
923       'type': 'none',
924       'variables': {
925         'nexe_target': 'pnacl_hw_eh_disabled',
926         'build_pnacl_newlib': 1,
927         'nexe_destination_dir': 'nacl_test_data',
928         'link_flags': [
929           '-lppapi',
930           '-lppapi_test_lib',
931           '-lplatform',
932           '-lgio',
933           # The "_private" variant of the library calls the syscalls
934           # directly, which allows us to test the syscalls directly,
935           # even when the exception-handling IRT interface is also
936           # disabled under PNaCl.
937           '-lnacl_exception_private',
938         ],
939         'sources': [
940           'pnacl_hw_eh_disabled/pnacl_hw_eh_disabled.cc',
941         ],
942         'test_files': [
943           'pnacl_hw_eh_disabled/pnacl_hw_eh_disabled.html',
944         ],
945       },
946       'dependencies': [
947         '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio_lib',
948         '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform_lib',
949         '<(DEPTH)/native_client/src/untrusted/nacl/nacl.gyp:nacl_exception_private_lib',
950         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
951         '<(DEPTH)/ppapi/native_client/native_client.gyp:ppapi_lib',
952         '<(DEPTH)/ppapi/ppapi_nacl.gyp:ppapi_cpp_lib',
953         'ppapi_test_lib',
954       ],
955     },
956     # Legacy NaCl PPAPI interface tests being here.
957     {
958       'target_name': 'ppapi_ppb_core',
959       'type': 'none',
960       'variables': {
961         'nexe_target': 'ppapi_ppb_core',
962         'build_newlib': 1,
963         'build_glibc': 1,
964         'build_pnacl_newlib': 1,
965         'nexe_destination_dir': 'nacl_test_data',
966         'link_flags': [
967           '-lppapi',
968           '-lppapi_test_lib',
969           '-lplatform',
970           '-lgio',
971         ],
972         'sources': [
973           'ppapi/ppb_core/ppapi_ppb_core.cc',
974         ],
975         'test_files': [
976           'ppapi/ppb_core/ppapi_ppb_core.html',
977         ],
978       },
979       'dependencies': [
980         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
981         '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform_lib',
982         '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio_lib',
983         '<(DEPTH)/ppapi/native_client/native_client.gyp:ppapi_lib',
984         '<(DEPTH)/ppapi/ppapi_nacl.gyp:ppapi_cpp_lib',
985         'ppapi_test_lib',
986       ],
987     },
988     {
989       'target_name': 'ppapi_ppb_instance',
990       'type': 'none',
991       'variables': {
992         'nexe_target': 'ppapi_ppb_instance',
993         'build_newlib': 1,
994         'build_glibc': 1,
995         'build_pnacl_newlib': 1,
996         'nexe_destination_dir': 'nacl_test_data',
997         'link_flags': [
998           '-lppapi',
999           '-lppapi_test_lib',
1000           '-lplatform',
1001           '-lgio',
1002         ],
1003         'sources': [
1004           'ppapi/ppb_instance/ppapi_ppb_instance.cc',
1005         ],
1006         'test_files': [
1007           'ppapi/ppb_instance/ppapi_ppb_instance.html',
1008         ],
1009       },
1010       'dependencies': [
1011         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
1012         '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform_lib',
1013         '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio_lib',
1014         '<(DEPTH)/ppapi/native_client/native_client.gyp:ppapi_lib',
1015         '<(DEPTH)/ppapi/ppapi_nacl.gyp:ppapi_cpp_lib',
1016         'ppapi_test_lib',
1017       ],
1018     },
1019     {
1020       'target_name': 'ppapi_ppp_instance',
1021       'type': 'none',
1022       'variables': {
1023         'nexe_target': 'ppapi_ppp_instance',
1024         'build_newlib': 1,
1025         'build_glibc': 1,
1026         'build_pnacl_newlib': 1,
1027         'nexe_destination_dir': 'nacl_test_data',
1028         'link_flags': [
1029           '-lppapi',
1030           '-lppapi_test_lib',
1031           '-lplatform',
1032           '-lgio',
1033         ],
1034         'sources': [
1035           'ppapi/ppp_instance/ppapi_ppp_instance.cc',
1036         ],
1037         'test_files': [
1038           'ppapi/ppp_instance/ppapi_ppp_instance.html',
1039           'ppapi/ppp_instance/ppapi_ppp_instance.js',
1040         ],
1041       },
1042       'dependencies': [
1043         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
1044         '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform_lib',
1045         '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio_lib',
1046         '<(DEPTH)/ppapi/native_client/native_client.gyp:ppapi_lib',
1047         '<(DEPTH)/ppapi/ppapi_nacl.gyp:ppapi_cpp_lib',
1048         'ppapi_test_lib',
1049       ],
1050     },
1051   ],
1052   'conditions': [
1053     ['target_arch!="arm"', {
1054       # Source file does not have asm for ARM.
1055       'targets': [
1056         {
1057           'target_name': 'partly_invalid',
1058           'type': 'none',
1059           'variables': {
1060             'nexe_target': 'partly_invalid',
1061             'build_newlib': 1,
1062             'build_glibc': 0,
1063             'build_pnacl_newlib': 0,
1064             'nexe_destination_dir': 'nacl_test_data',
1065             'sources': [
1066               '<(DEPTH)/native_client/tests/stubout_mode/partly_invalid.c',
1067             ],
1068             'conditions': [
1069               ['target_arch=="mipsel"', {
1070                 'compile_flags': [
1071                   '--pnacl-mips-bias',
1072                   '-arch', 'mips32',
1073                   '--pnacl-allow-translate',
1074                 ],
1075                 'link_flags': [
1076                   '--pnacl-allow-native',
1077                 ],
1078               }],
1079             ],
1080           },
1081           'dependencies': [
1082             '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
1083           ],
1084         },
1085       ],
1086     }],
1087
1088     # Tests for non-SFI mode.
1089     ['OS=="linux"', {
1090       'targets': [
1091         {
1092           'target_name': 'nonsfi_libc_free_nexe',
1093           'type': 'executable',
1094           'product_name': '>(nexe_destination_dir)/libc_free_>(arch_suffix)',
1095           'product_extension': 'nexe',
1096           'variables': {
1097             'arch_suffix': '<(target_arch)',
1098             # This is needed, because NaCl's target_default rule is
1099             # automatically applied to all the targets in this file, and it
1100             # requires nexe_destination_dir, even if it is not important.
1101             'nexe_destination_dir': 'nacl_test_data/libc-free',
1102           },
1103           'sources': [
1104             'nonsfi/libc_free.c',
1105           ],
1106           # Here, we would like to link a relocatable, libc-free executable.
1107           # -shared/-fPIC make this binary relocatable. -nostdlib ensures
1108           # this is libc-free.
1109           # The program does not apply any dynamic relocations at start up,
1110           # so it cannot rely on relocations having been applied.
1111           # In addition, -fvisibility=hidden avoids creating some types
1112           # of relocation.
1113           'cflags': [
1114             '-fPIC',
1115             '-fvisibility=hidden',
1116
1117             # Stack-Smashing protector does not work with libc-free context.
1118             '-fno-stack-protector',
1119             # Optimizers may translate the original code to code which
1120             # requires builtin functions and/or relocations. Specifically,
1121             # the LLVM's optimizer translates for-loop based zero
1122             # clear to memset.
1123             '-O0',
1124           ],
1125           'cflags!': [
1126             # We filter these out because release_extra_cflags or another
1127             # such thing might be adding them in, and those options wind up
1128             # coming after the -fno-stack-protector we added above.
1129             '-fstack-protector',
1130             '-fstack-protector-all',
1131             '-fprofile-generate',
1132             '-finstrument-functions',
1133             # ARM GCC emits symbols like __aeabi_unwind_cpp_pr0 in
1134             # .exidx sections with this flag.
1135             '-funwind-tables',
1136           ],
1137           'ldflags': [
1138             '-nostdlib',
1139             '-shared',
1140             # This binary cannot relocate itself, so we should have no
1141             # undefined references left.
1142             '-Wl,--no-undefined',
1143           ],
1144           'ldflags!': [
1145             # Explicitly remove the -pthread flag to avoid a link time warning.
1146             '-pthread',
1147           ],
1148           # Do not use any sanitizers tools, which require a few symbols.
1149           'cflags/': [
1150             ['exclude', '-fsanitize'],
1151             ['exclude', '^-O'],  # Strip -O2, -Os etc.
1152           ],
1153           'ldflags/': [
1154             ['exclude', '-fsanitize'],
1155           ],
1156           'defines': [
1157             # The code depends on NaCl's headers. This is a macro for them.
1158             'NACL_LINUX=1',
1159           ],
1160           # For native_client/src/include/...
1161           'include_dirs': [
1162             '../../../..',
1163           ],
1164           'conditions': [
1165             # Overwrite suffix for x64 and ia32 to align NaCl's naming
1166             # convention.
1167             ['target_arch=="x64"', {
1168               'variables': {
1169                 'arch_suffix': 'x86_64',
1170               }
1171             }],
1172             ['target_arch=="ia32"', {
1173               'variables': {
1174                 'arch_suffix': 'x86_32',
1175               }
1176             }],
1177           ],
1178         },
1179         {
1180           'target_name': 'nonsfi_libc_free',
1181           'type': 'none',
1182           'variables': {
1183             'nexe_destination_dir': 'nacl_test_data',
1184             'destination_dir': '<(PRODUCT_DIR)/>(nexe_destination_dir)/libc-free',
1185             'test_files': [
1186               # TODO(ncbray) move into chrome/test/data/nacl when all tests are
1187               # converted.
1188               '<(DEPTH)/ppapi/native_client/tools/browser_tester/browserdata/nacltest.js',
1189               'nonsfi/libc_free.html',
1190               'nonsfi/libc_free.nmf',
1191               'nonsfi/irt_test.html',
1192             ],
1193           },
1194           'dependencies': [
1195             'nonsfi_libc_free_nexe',
1196           ],
1197           # Because we are still under development for non-SFI mode, the
1198           # toolchain is not yet ready, which means ppapi_nacl_common does not
1199           # work well for non-SFI mode yet. Instead, we manually set up the
1200           # testing environment here.
1201           'copies': [
1202             {
1203               'destination': '>(destination_dir)',
1204               'files': [
1205                 '>@(test_files)',
1206               ],
1207             },
1208           ],
1209         },
1210       ],
1211     }],
1212   ],
1213 }