OLD | NEW |
1 # -*- python -*- | 1 # -*- python -*- |
2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 import platform | 6 import platform |
7 import os | 7 import os |
8 | 8 |
9 Import('env') | 9 Import('env') |
10 | 10 |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 'kernel32', | 281 'kernel32', |
282 'advapi32', | 282 'advapi32', |
283 'winmm', | 283 'winmm', |
284 # TODO(gregoryd): ntdll.lib is required for sem_get_value implementation but | 284 # TODO(gregoryd): ntdll.lib is required for sem_get_value implementation but |
285 # it is available in Windows DDK only. The DDK is not | 285 # it is available in Windows DDK only. The DDK is not |
286 # in third_party, but we might need to add it if we want to use it. | 286 # in third_party, but we might need to add it if we want to use it. |
287 # 'ntdll', | 287 # 'ntdll', |
288 ], | 288 ], |
289 ) | 289 ) |
290 | 290 |
291 if env.Bit('target_x86'): | |
292 VALIDATOR_LIB = env.NaClTargetArchSuffix('ncvalidate') | |
293 elif env.Bit('target_arm'): | |
294 VALIDATOR_LIB = 'ncvalidate_arm_v2' | |
295 else: | |
296 # Unknown architecture | |
297 raise AssertionError('Unknown architecture') | |
298 | |
299 r_debug_objs = [] | 291 r_debug_objs = [] |
300 if env.Bit('linux'): | 292 if env.Bit('linux'): |
301 r_debug_objs += [env.ComponentObject('linux/r_debug.c')] | 293 r_debug_objs += [env.ComponentObject('linux/r_debug.c')] |
302 | 294 |
303 sel_ldr_libs = ['sel', | 295 sel_ldr_libs = ['sel', |
304 'env_cleanser', | 296 'env_cleanser', |
305 'nacl_error_code', | 297 'nacl_error_code', |
306 'manifest_proxy', | 298 'manifest_proxy', |
307 'simple_service', | 299 'simple_service', |
308 'thread_interface', | 300 'thread_interface', |
309 'gio_wrapped_desc', | 301 'gio_wrapped_desc', |
310 'nonnacl_srpc', | 302 'nonnacl_srpc', |
311 'nrd_xfer', | 303 'nrd_xfer', |
312 'nacl_perf_counter', | 304 'nacl_perf_counter', |
313 'nacl_base', | 305 'nacl_base', |
314 'imc', | 306 'imc', |
315 'container', | 307 'container', |
316 'nacl_fault_inject', | 308 'nacl_fault_inject', |
317 'nacl_interval', | 309 'nacl_interval', |
318 'platform', | 310 'platform', |
319 'platform_qual_lib', | 311 'platform_qual_lib', |
320 VALIDATOR_LIB, | |
321 ] + DEBUG_LIBS | 312 ] + DEBUG_LIBS |
322 if ((not env.Bit('coverage_enabled') or not env.Bit('windows')) and | 313 if ((not env.Bit('coverage_enabled') or not env.Bit('windows')) and |
323 not env.CrossToolsBuild()): | 314 not env.CrossToolsBuild()): |
324 sel_main_objs = [env.ComponentObject('sel_main.c')] + r_debug_objs | 315 sel_main_objs = [env.ComponentObject('sel_main.c')] + r_debug_objs |
325 SEL_LDR_NODE = env.ComponentProgram('sel_ldr', sel_main_objs, | 316 SEL_LDR_NODE = env.ComponentProgram('sel_ldr', sel_main_objs, |
326 EXTRA_LIBS=sel_ldr_libs) | 317 EXTRA_LIBS=sel_ldr_libs) |
327 if env.Bit('mac'): | 318 if env.Bit('mac'): |
328 # This target exists only to check that the service_runtime code | 319 # This target exists only to check that the service_runtime code |
329 # can successfully be linked into a Mac OS X dynamic library. Our | 320 # can successfully be linked into a Mac OS X dynamic library. Our |
330 # assembly code needs to be PIC-friendly and linkable in this | 321 # assembly code needs to be PIC-friendly and linkable in this |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 'thread_interface', | 447 'thread_interface', |
457 'gio_wrapped_desc', | 448 'gio_wrapped_desc', |
458 'nonnacl_srpc', | 449 'nonnacl_srpc', |
459 'nrd_xfer', | 450 'nrd_xfer', |
460 'nacl_perf_counter', | 451 'nacl_perf_counter', |
461 'nacl_base', | 452 'nacl_base', |
462 'imc', | 453 'imc', |
463 'nacl_fault_inject', | 454 'nacl_fault_inject', |
464 'nacl_interval', | 455 'nacl_interval', |
465 'platform', | 456 'platform', |
466 VALIDATOR_LIB, | |
467 ] + DEBUG_LIBS) | 457 ] + DEBUG_LIBS) |
468 gtest_env.Requires(unit_tests_exe, crt) | 458 gtest_env.Requires(unit_tests_exe, crt) |
469 | 459 |
470 node = gtest_env.CommandTest( | 460 node = gtest_env.CommandTest( |
471 'gtest_output.xml.out', | 461 'gtest_output.xml.out', |
472 command=[unit_tests_exe, '--gtest_output=xml:${TARGET}']) | 462 command=[unit_tests_exe, '--gtest_output=xml:${TARGET}']) |
473 gtest_env.AddNodeToTestSuite(node, ['small_tests'], | 463 gtest_env.AddNodeToTestSuite(node, ['small_tests'], |
474 'run_service_runtime_tests') | 464 'run_service_runtime_tests') |
475 | 465 |
476 | 466 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 'thread_interface', | 504 'thread_interface', |
515 'gio_wrapped_desc', | 505 'gio_wrapped_desc', |
516 'nonnacl_srpc', | 506 'nonnacl_srpc', |
517 'nrd_xfer', | 507 'nrd_xfer', |
518 'nacl_perf_counter', | 508 'nacl_perf_counter', |
519 'nacl_base', | 509 'nacl_base', |
520 'imc', | 510 'imc', |
521 'nacl_fault_inject', | 511 'nacl_fault_inject', |
522 'nacl_interval', | 512 'nacl_interval', |
523 'platform', | 513 'platform', |
524 VALIDATOR_LIB, | |
525 ] + DEBUG_LIBS) | 514 ] + DEBUG_LIBS) |
526 env.Requires(mmap_test_exe, crt) | 515 env.Requires(mmap_test_exe, crt) |
527 | 516 |
528 mmap_test_file = env.File(arch_testdata_dir + '/hello_world.nexe') | 517 mmap_test_file = env.File(arch_testdata_dir + '/hello_world.nexe') |
529 bootstrap, bootstrap_arg = env.GetBootstrap() | 518 bootstrap, bootstrap_arg = env.GetBootstrap() |
530 if bootstrap is None: | 519 if bootstrap is None: |
531 mmap_test_command = [mmap_test_exe, mmap_test_file] | 520 mmap_test_command = [mmap_test_exe, mmap_test_file] |
532 else: | 521 else: |
533 mmap_test_command = [bootstrap, mmap_test_exe, | 522 mmap_test_command = [bootstrap, mmap_test_exe, |
534 bootstrap_arg, mmap_test_file] | 523 bootstrap_arg, mmap_test_file] |
(...skipping 23 matching lines...) Expand all Loading... |
558 'thread_interface', | 547 'thread_interface', |
559 'gio_wrapped_desc', | 548 'gio_wrapped_desc', |
560 'nonnacl_srpc', | 549 'nonnacl_srpc', |
561 'nrd_xfer', | 550 'nrd_xfer', |
562 'nacl_perf_counter', | 551 'nacl_perf_counter', |
563 'nacl_base', | 552 'nacl_base', |
564 'imc', | 553 'imc', |
565 'nacl_fault_inject', | 554 'nacl_fault_inject', |
566 'nacl_interval', | 555 'nacl_interval', |
567 'platform', | 556 'platform', |
568 VALIDATOR_LIB, | |
569 ] + DEBUG_LIBS) | 557 ] + DEBUG_LIBS) |
570 env.Requires(nacl_sync_cond_test_exe, crt) | 558 env.Requires(nacl_sync_cond_test_exe, crt) |
571 node = env.CommandTest( | 559 node = env.CommandTest( |
572 'nacl_sync_cond_test.out', | 560 'nacl_sync_cond_test.out', |
573 command=[nacl_sync_cond_test_exe]) | 561 command=[nacl_sync_cond_test_exe]) |
574 env.AddNodeToTestSuite(node, | 562 env.AddNodeToTestSuite(node, |
575 ['medium_tests'], | 563 ['medium_tests'], |
576 'run_nacl_sync_cond_test', | 564 'run_nacl_sync_cond_test', |
577 is_broken=is_broken) | 565 is_broken=is_broken) |
578 | 566 |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
785 'nonnacl_srpc', | 773 'nonnacl_srpc', |
786 'nrd_xfer', | 774 'nrd_xfer', |
787 'nacl_perf_counter', | 775 'nacl_perf_counter', |
788 'nacl_base', | 776 'nacl_base', |
789 'imc', | 777 'imc', |
790 'nacl_fault_inject', | 778 'nacl_fault_inject', |
791 'nacl_interval', | 779 'nacl_interval', |
792 'platform', | 780 'platform', |
793 'nacl_xdr', | 781 'nacl_xdr', |
794 'container', | 782 'container', |
795 VALIDATOR_LIB, | |
796 ] + DEBUG_LIBS) | 783 ] + DEBUG_LIBS) |
797 | 784 |
798 node = env.CommandTest( | 785 node = env.CommandTest( |
799 'obj_proxy_test.out', | 786 'obj_proxy_test.out', |
800 # NOTE: this is run out of obj/ rather than staging/ | 787 # NOTE: this is run out of obj/ rather than staging/ |
801 [obj_proxy_test, '-n', '2048'], | 788 [obj_proxy_test, '-n', '2048'], |
802 size='huge') | 789 size='huge') |
803 # TODO(bsy): change this test to use less time -- most of it (on windows) | 790 # TODO(bsy): change this test to use less time -- most of it (on windows) |
804 # is in the RNG, so with this will inherently speed up when the RNG is | 791 # is in the RNG, so with this will inherently speed up when the RNG is |
805 # updated. | 792 # updated. |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
937 'thread_interface', | 924 'thread_interface', |
938 'gio_wrapped_desc', | 925 'gio_wrapped_desc', |
939 'nonnacl_srpc', | 926 'nonnacl_srpc', |
940 'nrd_xfer', | 927 'nrd_xfer', |
941 'nacl_perf_counter', | 928 'nacl_perf_counter', |
942 'nacl_base', | 929 'nacl_base', |
943 'imc', | 930 'imc', |
944 'nacl_fault_inject', | 931 'nacl_fault_inject', |
945 'nacl_interval', | 932 'nacl_interval', |
946 'platform', | 933 'platform', |
947 VALIDATOR_LIB, | |
948 ] + DEBUG_LIBS) | 934 ] + DEBUG_LIBS) |
949 | 935 |
950 # NaClAbort() behaves differently when code coverage is enabled: it | 936 # NaClAbort() behaves differently when code coverage is enabled: it |
951 # calls exit() rather than abort(). | 937 # calls exit() rather than abort(). |
952 if env.Bit('coverage_enabled'): | 938 if env.Bit('coverage_enabled'): |
953 expected_exit_status = 'naclabort_coverage' | 939 expected_exit_status = 'naclabort_coverage' |
954 else: | 940 else: |
955 expected_exit_status = 'sigabrt' | 941 expected_exit_status = 'sigabrt' |
956 node = env.CommandTest( | 942 node = env.CommandTest( |
957 'sel_ldr_thread_death_test.out', | 943 'sel_ldr_thread_death_test.out', |
958 command=[sel_ldr_thread_death_test_exe], | 944 command=[sel_ldr_thread_death_test_exe], |
959 exit_status=expected_exit_status) | 945 exit_status=expected_exit_status) |
960 | 946 |
961 # TODO(tuduce): Make it work on windows. | 947 # TODO(tuduce): Make it work on windows. |
962 env.AddNodeToTestSuite(node, ['medium_tests'], | 948 env.AddNodeToTestSuite(node, ['medium_tests'], |
963 'run_sel_ldr_thread_death_test', | 949 'run_sel_ldr_thread_death_test', |
964 is_broken=env.Bit('windows')) | 950 is_broken=env.Bit('windows')) |
965 | 951 |
966 | 952 |
967 # This currently tests linking of sel_main_chrome.c *only*. We do not | 953 # This currently tests linking of sel_main_chrome.c *only*. We do not |
968 # expect this program to do anything meaningful when run. | 954 # expect this program to do anything meaningful when run. |
969 env.ComponentProgram('sel_main_chrome_test', ['sel_main_chrome_test.c'], | 955 env.ComponentProgram('sel_main_chrome_test', ['sel_main_chrome_test.c'], |
970 EXTRA_LIBS=sel_ldr_libs) | 956 EXTRA_LIBS=sel_ldr_libs) |
OLD | NEW |