Upstream version 10.39.225.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': 'irt_manifest_file',
502       'type': 'none',
503       'variables': {
504         'nexe_target': 'irt_manifest_file',
505         'build_newlib': 1,
506         # Linking problems - can't find __nacl_irt_query.
507         'build_glibc': 0,
508         # TODO(ncbray) support file injection into PNaCl manifest.
509         'build_pnacl_newlib': 0,
510         'nexe_destination_dir': 'nacl_test_data',
511         'link_flags': [
512           '-lnacl_ppapi_util',
513           '-lppapi_cpp',
514           '-lppapi',
515           '-lsrpc',
516           '-lplatform',
517           '-lgio',
518           '-limc',
519           '-limc_syscalls',
520           '-lweak_ref',
521           '-lnacl',
522         ],
523         'sources': [
524           'manifest_file/irt_manifest_file_test.cc',
525         ],
526         'create_nmf_args_portable': [
527           '-xtest_file:test_file.txt',
528           '-xnmf says hello world:test_file.txt',
529           # There is no dummy_test_file.txt file intentionally. This is just for
530           # a test case where there is a manifest entry, but no actual file.
531           '-xdummy_test_file:dummy_test_file.txt',
532         ],
533         'test_files': [
534           'manifest_file/irt_manifest_file_test.html',
535         ],
536       },
537       'dependencies': [
538         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
539         '<(DEPTH)/ppapi/ppapi_nacl.gyp:ppapi_cpp_lib',
540         '<(DEPTH)/ppapi/native_client/native_client.gyp:ppapi_lib',
541         '<(DEPTH)/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_irt_shim.gyp:aot',
542         '<(DEPTH)/native_client/src/shared/srpc/srpc.gyp:srpc_lib',
543         '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform_lib',
544         '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio_lib',
545         '<(DEPTH)/native_client/src/shared/imc/imc.gyp:imc_lib',
546         '<(DEPTH)/native_client/src/untrusted/nacl/nacl.gyp:imc_syscalls_lib',
547         '<(DEPTH)/native_client/src/untrusted/nacl/nacl.gyp:nacl_lib',
548         '<(DEPTH)/native_client/src/trusted/weak_ref/weak_ref.gyp:weak_ref_lib',
549         'nacl_ppapi_util',
550       ],
551       'conditions': [
552         ['target_arch=="ia32" and OS=="linux"', {
553           # Enable nonsfi testing only on ia32-linux environment.
554           'variables': {
555             # This is needed to build a non-SFI nexe binary.
556             # Note that this triggers building nexe files for other
557             # architectures, such as x86-32 (based on enable_XXX variables).
558             # As described above, although the tests for pnacl are currently
559             # disabled, but building the binary should work.
560             # We cannot disable building, as enable_XXX variables are also used
561             # to build newlib linked nexes.
562             'build_pnacl_newlib': 1,
563             'translate_pexe_with_build': 1,
564             'enable_x86_32_nonsfi': 1,
565           },
566         }],
567       ],
568     },
569     {
570       'target_name': 'irt_exception_test',
571       'type': 'none',
572       'variables': {
573         'nexe_target': 'irt_exception_test',
574         'build_newlib': 1,
575         'generate_nmf': 1,
576         'nexe_destination_dir': 'nacl_test_data',
577         'build_pnacl_newlib': 1,
578         'link_flags': [
579           '-lppapi',
580           '-lppapi_test_lib',
581           '-lplatform',
582           '-lgio',
583           '-lnacl_exception',
584         ],
585         'sources': [
586           'irt_exception/irt_exception_test.cc',
587         ],
588         'test_files': [
589           # TODO(ncbray) move into chrome/test/data/nacl when all tests are
590           # converted.
591           'irt_exception/irt_exception_test.html',
592         ],
593       },
594       'dependencies': [
595         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
596         '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform_lib',
597         '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio_lib',
598         '<(DEPTH)/native_client/src/untrusted/nacl/nacl.gyp:nacl_exception_lib',
599         '<(DEPTH)/ppapi/native_client/native_client.gyp:ppapi_lib',
600         '<(DEPTH)/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_irt_shim.gyp:aot',
601         '<(DEPTH)/ppapi/ppapi_nacl.gyp:ppapi_cpp_lib',
602         'ppapi_test_lib',
603       ],
604       'conditions': [
605         ['target_arch=="ia32" and OS=="linux"', {
606           # Enable nonsfi testing only on ia32-linux environment.
607           'variables': {
608             'enable_x86_32_nonsfi': 1,
609             'translate_pexe_with_build': 1,
610           },
611         }],
612       ],
613     },
614     {
615       'target_name': 'ppapi_extension_mime_handler',
616       'type': 'none',
617       'variables': {
618         'nexe_target': 'ppapi_extension_mime_handler',
619         'build_newlib': 1,
620         'build_glibc': 0,
621         'build_pnacl_newlib': 0,
622         'nexe_destination_dir': 'nacl_test_data',
623         'link_flags': [
624           '-lppapi',
625           '-lppapi_test_lib',
626           '-lplatform',
627           '-lgio',
628         ],
629         'sources': [
630           'extension_mime_handler/ppapi_extension_mime_handler.cc',
631         ],
632         'test_files': [
633           'extension_mime_handler/ppapi_extension_mime_handler.html',
634           'extension_mime_handler/mime_test_data.dat',
635           # For faking the file's MIME type.
636           'extension_mime_handler/mime_test_data.dat.mock-http-headers',
637           # Turns the test data directory into an extension.  Hackish.
638           # Note that the .nexe names are embedded in this file.
639           'extension_mime_handler/manifest.json',
640         ],
641       },
642       'dependencies': [
643         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
644         '<(DEPTH)/ppapi/native_client/native_client.gyp:ppapi_lib',
645         '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform_lib',
646         '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio_lib',
647         'ppapi_test_lib',
648       ],
649     },
650     {
651       'target_name': 'pnacl_debug_url_test',
652       'type': 'none',
653       'variables': {
654         'nexe_target': 'pnacl_debug_url',
655         'build_pnacl_newlib': 1,
656         'nexe_destination_dir': 'nacl_test_data',
657         'generate_nmf': 0,
658         'sources': [
659           'simple.cc',
660         ],
661         'test_files': [
662           'pnacl_debug_url/pnacl_debug_url.html',
663           'pnacl_debug_url/pnacl_has_debug.nmf',
664           'pnacl_debug_url/pnacl_has_debug_flag_off.nmf',
665           'pnacl_debug_url/pnacl_no_debug.nmf',
666         ],
667       },
668       'dependencies': [
669         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
670       ]
671     },
672     {
673       'target_name': 'pnacl_error_handling_test',
674       'type': 'none',
675       'variables': {
676         'build_pnacl_newlib': 1,
677         'nexe_destination_dir': 'nacl_test_data',
678         # Use prebuilt NMF files.
679         'generate_nmf': 0,
680         'test_files': [
681           'pnacl_error_handling/pnacl_error_handling.html',
682           'pnacl_error_handling/bad.pexe',
683           'pnacl_error_handling/pnacl_bad_pexe.nmf',
684           'pnacl_error_handling/pnacl_bad_doesnotexist.nmf',
685           'pnacl_error_handling/pnacl_illformed_manifest.nmf',
686         ],
687       },
688       'dependencies': [
689         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
690       ]
691     },
692     {
693       'target_name': 'pnacl_mime_type_test',
694       'type': 'none',
695       'variables': {
696         'build_newlib': 1,
697         'build_glibc': 1,
698         'build_pnacl_newlib': 1,
699         'nexe_destination_dir': 'nacl_test_data',
700         'test_files': [
701           'pnacl_mime_type/pnacl_mime_type.html',
702         ],
703       },
704     },
705     {
706       'target_name': 'pnacl_options_test',
707       'type': 'none',
708       'variables': {
709         'nexe_target': 'pnacl_options',
710         'build_pnacl_newlib': 1,
711         'nexe_destination_dir': 'nacl_test_data',
712         'generate_nmf': 0,
713         'sources': [
714           'simple.cc',
715         ],
716         'test_files': [
717           'pnacl_nmf_options/pnacl_options.html',
718           'pnacl_nmf_options/pnacl_o_0.nmf',
719           'pnacl_nmf_options/pnacl_o_2.nmf',
720           'pnacl_nmf_options/pnacl_o_large.nmf',
721         ],
722       },
723       'dependencies': [
724         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
725       ]
726     },
727     {
728       'target_name': 'pnacl_dyncode_syscall_disabled_test',
729       'type': 'none',
730       'variables': {
731         'nexe_target': 'pnacl_dyncode_syscall_disabled',
732         'build_pnacl_newlib': 1,
733         'nexe_destination_dir': 'nacl_test_data',
734         'link_flags': [
735           '-lppapi',
736           '-lppapi_test_lib',
737           '-lplatform',
738           '-lgio',
739           # The "_private" variant of the library calls the syscalls
740           # directly, which allows us to test the syscalls directly,
741           # even when the dyncode IRT interface is also disabled under
742           # PNaCl.
743           '-lnacl_dyncode_private',
744         ],
745         'sources': [
746           'pnacl_dyncode_syscall_disabled/pnacl_dyncode_syscall_disabled.cc',
747         ],
748         'test_files': [
749           'pnacl_dyncode_syscall_disabled/pnacl_dyncode_syscall_disabled.html',
750         ],
751       },
752       'dependencies': [
753         '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio_lib',
754         '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform_lib',
755         '<(DEPTH)/native_client/src/untrusted/nacl/nacl.gyp:nacl_dyncode_private_lib',
756         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
757         '<(DEPTH)/ppapi/native_client/native_client.gyp:ppapi_lib',
758         '<(DEPTH)/ppapi/ppapi_nacl.gyp:ppapi_cpp_lib',
759         'ppapi_test_lib',
760       ],
761     },
762     {
763       'target_name': 'pnacl_hw_eh_disabled_test',
764       'type': 'none',
765       'variables': {
766         'nexe_target': 'pnacl_hw_eh_disabled',
767         'build_pnacl_newlib': 1,
768         'nexe_destination_dir': 'nacl_test_data',
769         'link_flags': [
770           '-lppapi',
771           '-lppapi_test_lib',
772           '-lplatform',
773           '-lgio',
774           # The "_private" variant of the library calls the syscalls
775           # directly, which allows us to test the syscalls directly,
776           # even when the exception-handling IRT interface is also
777           # disabled under PNaCl.
778           '-lnacl_exception_private',
779         ],
780         'sources': [
781           'pnacl_hw_eh_disabled/pnacl_hw_eh_disabled.cc',
782         ],
783         'test_files': [
784           'pnacl_hw_eh_disabled/pnacl_hw_eh_disabled.html',
785         ],
786       },
787       'dependencies': [
788         '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio_lib',
789         '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform_lib',
790         '<(DEPTH)/native_client/src/untrusted/nacl/nacl.gyp:nacl_exception_private_lib',
791         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
792         '<(DEPTH)/ppapi/native_client/native_client.gyp:ppapi_lib',
793         '<(DEPTH)/ppapi/ppapi_nacl.gyp:ppapi_cpp_lib',
794         'ppapi_test_lib',
795       ],
796     },
797     # Legacy NaCl PPAPI interface tests being here.
798     {
799       'target_name': 'ppapi_ppb_core',
800       'type': 'none',
801       'variables': {
802         'nexe_target': 'ppapi_ppb_core',
803         'build_newlib': 1,
804         'build_glibc': 1,
805         'build_pnacl_newlib': 1,
806         'nexe_destination_dir': 'nacl_test_data',
807         'link_flags': [
808           '-lppapi',
809           '-lppapi_test_lib',
810           '-lplatform',
811           '-lgio',
812         ],
813         'sources': [
814           'ppapi/ppb_core/ppapi_ppb_core.cc',
815         ],
816         'test_files': [
817           'ppapi/ppb_core/ppapi_ppb_core.html',
818         ],
819       },
820       'dependencies': [
821         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
822         '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform_lib',
823         '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio_lib',
824         '<(DEPTH)/ppapi/native_client/native_client.gyp:ppapi_lib',
825         '<(DEPTH)/ppapi/ppapi_nacl.gyp:ppapi_cpp_lib',
826         'ppapi_test_lib',
827       ],
828     },
829     {
830       'target_name': 'ppapi_ppb_instance',
831       'type': 'none',
832       'variables': {
833         'nexe_target': 'ppapi_ppb_instance',
834         'build_newlib': 1,
835         'build_glibc': 1,
836         'build_pnacl_newlib': 1,
837         'nexe_destination_dir': 'nacl_test_data',
838         'link_flags': [
839           '-lppapi',
840           '-lppapi_test_lib',
841           '-lplatform',
842           '-lgio',
843         ],
844         'sources': [
845           'ppapi/ppb_instance/ppapi_ppb_instance.cc',
846         ],
847         'test_files': [
848           'ppapi/ppb_instance/ppapi_ppb_instance.html',
849         ],
850       },
851       'dependencies': [
852         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
853         '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform_lib',
854         '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio_lib',
855         '<(DEPTH)/ppapi/native_client/native_client.gyp:ppapi_lib',
856         '<(DEPTH)/ppapi/ppapi_nacl.gyp:ppapi_cpp_lib',
857         'ppapi_test_lib',
858       ],
859     },
860     {
861       'target_name': 'ppapi_ppp_instance',
862       'type': 'none',
863       'variables': {
864         'nexe_target': 'ppapi_ppp_instance',
865         'build_newlib': 1,
866         'build_glibc': 1,
867         'build_pnacl_newlib': 1,
868         'nexe_destination_dir': 'nacl_test_data',
869         'link_flags': [
870           '-lppapi',
871           '-lppapi_test_lib',
872           '-lplatform',
873           '-lgio',
874         ],
875         'sources': [
876           'ppapi/ppp_instance/ppapi_ppp_instance.cc',
877         ],
878         'test_files': [
879           'ppapi/ppp_instance/ppapi_ppp_instance.html',
880           'ppapi/ppp_instance/ppapi_ppp_instance.js',
881         ],
882       },
883       'dependencies': [
884         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
885         '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform_lib',
886         '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio_lib',
887         '<(DEPTH)/ppapi/native_client/native_client.gyp:ppapi_lib',
888         '<(DEPTH)/ppapi/ppapi_nacl.gyp:ppapi_cpp_lib',
889         'ppapi_test_lib',
890       ],
891     },
892   ],
893   'conditions': [
894     ['target_arch!="arm"', {
895       # Source file does not have asm for ARM.
896       'targets': [
897         {
898           'target_name': 'partly_invalid',
899           'type': 'none',
900           'variables': {
901             'nexe_target': 'partly_invalid',
902             'build_newlib': 1,
903             'build_glibc': 0,
904             'build_pnacl_newlib': 0,
905             'nexe_destination_dir': 'nacl_test_data',
906             'sources': [
907               '<(DEPTH)/native_client/tests/stubout_mode/partly_invalid.c',
908             ],
909             'conditions': [
910               ['target_arch=="mipsel"', {
911                 'compile_flags': [
912                   '--pnacl-mips-bias',
913                   '-arch', 'mips32',
914                   '--pnacl-allow-translate',
915                 ],
916                 'link_flags': [
917                   '--pnacl-allow-native',
918                 ],
919               }],
920             ],
921           },
922           'dependencies': [
923             '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
924           ],
925         },
926       ],
927     }],
928
929     # Tests for non-SFI mode.
930     ['OS=="linux"', {
931       'targets': [
932         {
933           'target_name': 'nonsfi_libc_free_nexe',
934           'type': 'executable',
935           'product_name': '>(nexe_destination_dir)/libc_free_>(arch_suffix)',
936           'product_extension': 'nexe',
937           'variables': {
938             'arch_suffix': '<(target_arch)',
939             # This is needed, because NaCl's target_default rule is
940             # automatically applied to all the targets in this file, and it
941             # requires nexe_destination_dir, even if it is not important.
942             'nexe_destination_dir': 'nacl_test_data/libc-free',
943           },
944           'sources': [
945             'nonsfi/libc_free.c',
946           ],
947           # Here, we would like to link a relocatable, libc-free executable.
948           # -shared/-fPIC make this binary relocatable. -nostdlib ensures
949           # this is libc-free.
950           # The program does not apply any dynamic relocations at start up,
951           # so it cannot rely on relocations having been applied.
952           # In addition, -fvisibility=hidden avoids creating some types
953           # of relocation.
954           'cflags': [
955             '-fPIC',
956             '-fvisibility=hidden',
957
958             # Stack-Smashing protector does not work with libc-free context.
959             '-fno-stack-protector',
960             # Optimizers may translate the original code to code which
961             # requires builtin functions and/or relocations. Specifically,
962             # the LLVM's optimizer translates for-loop based zero
963             # clear to memset.
964             '-O0',
965           ],
966           'cflags!': [
967             # We filter these out because release_extra_cflags or another
968             # such thing might be adding them in, and those options wind up
969             # coming after the -fno-stack-protector we added above.
970             '-fstack-protector',
971             '-fstack-protector-all',
972             '-fprofile-generate',
973             '-finstrument-functions',
974             # ARM GCC emits symbols like __aeabi_unwind_cpp_pr0 in
975             # .exidx sections with this flag.
976             '-funwind-tables',
977           ],
978           'ldflags': [
979             '-nostdlib',
980             '-shared',
981             # This binary cannot relocate itself, so we should have no
982             # undefined references left.
983             '-Wl,--no-undefined',
984           ],
985           'ldflags!': [
986             # Explicitly remove the -pthread flag to avoid a link time warning.
987             '-pthread',
988           ],
989           # Do not use any sanitizers tools, which require a few symbols.
990           'cflags/': [
991             ['exclude', '-fsanitize'],
992             ['exclude', '^-O'],  # Strip -O2, -Os etc.
993           ],
994           'ldflags/': [
995             ['exclude', '-fsanitize'],
996           ],
997           'defines': [
998             # The code depends on NaCl's headers. This is a macro for them.
999             'NACL_LINUX=1',
1000           ],
1001           # For native_client/src/include/...
1002           'include_dirs': [
1003             '../../../..',
1004           ],
1005           'conditions': [
1006             # Overwrite suffix for x64 and ia32 to align NaCl's naming
1007             # convention.
1008             ['target_arch=="x64"', {
1009               'variables': {
1010                 'arch_suffix': 'x86_64',
1011               }
1012             }],
1013             ['target_arch=="ia32"', {
1014               'variables': {
1015                 'arch_suffix': 'x86_32',
1016               }
1017             }],
1018           ],
1019         },
1020         {
1021           'target_name': 'nonsfi_libc_free',
1022           'type': 'none',
1023           'variables': {
1024             'nexe_destination_dir': 'nacl_test_data',
1025             'destination_dir': '<(PRODUCT_DIR)/>(nexe_destination_dir)/libc-free',
1026             'test_files': [
1027               # TODO(ncbray) move into chrome/test/data/nacl when all tests are
1028               # converted.
1029               '<(DEPTH)/ppapi/native_client/tools/browser_tester/browserdata/nacltest.js',
1030               'nonsfi/libc_free.html',
1031               'nonsfi/libc_free.nmf',
1032               'nonsfi/irt_test.html',
1033             ],
1034           },
1035           'dependencies': [
1036             'nonsfi_libc_free_nexe',
1037           ],
1038           # Because we are still under development for non-SFI mode, the
1039           # toolchain is not yet ready, which means ppapi_nacl_common does not
1040           # work well for non-SFI mode yet. Instead, we manually set up the
1041           # testing environment here.
1042           'copies': [
1043             {
1044               'destination': '>(destination_dir)',
1045               'files': [
1046                 '>@(test_files)',
1047               ],
1048             },
1049           ],
1050         },
1051       ],
1052     }],
1053   ],
1054 }