Chromium Code Reviews| 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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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'): | 291 if env.Bit('target_x86'): |
| 292 VALIDATOR_LIB = env.NaClTargetArchSuffix('ncvalidate') | 292 VALIDATOR_LIBS = [env.NaClTargetArchSuffix('ncvalidate'), |
| 293 env.NaClTargetArchSuffix('dfa_validate_caller'), | |
| 294 env.NaClTargetArchSuffix('dfa_validate'), | |
| 295 ] | |
| 293 elif env.Bit('target_arm'): | 296 elif env.Bit('target_arm'): |
| 294 VALIDATOR_LIB = 'ncvalidate_arm_v2' | 297 VALIDATOR_LIBS = ['ncvalidate_arm_v2'] |
| 295 else: | 298 else: |
| 296 # Unknown architecture | 299 # Unknown architecture |
| 297 raise AssertionError('Unknown architecture') | 300 raise AssertionError('Unknown architecture') |
| 298 | 301 |
| 299 r_debug_objs = [] | 302 r_debug_objs = [] |
| 300 if env.Bit('linux'): | 303 if env.Bit('linux'): |
| 301 r_debug_objs += [env.ComponentObject('linux/r_debug.c')] | 304 r_debug_objs += [env.ComponentObject('linux/r_debug.c')] |
| 302 | 305 |
| 303 sel_ldr_libs = ['sel', | 306 sel_ldr_libs = ['sel', |
| 304 'env_cleanser', | 307 'env_cleanser', |
| 305 'nacl_error_code', | 308 'nacl_error_code', |
| 306 'manifest_proxy', | 309 'manifest_proxy', |
| 307 'simple_service', | 310 'simple_service', |
| 308 'thread_interface', | 311 'thread_interface', |
| 309 'gio_wrapped_desc', | 312 'gio_wrapped_desc', |
| 310 'nonnacl_srpc', | 313 'nonnacl_srpc', |
| 311 'nrd_xfer', | 314 'nrd_xfer', |
| 312 'nacl_perf_counter', | 315 'nacl_perf_counter', |
| 313 'nacl_base', | 316 'nacl_base', |
| 314 'imc', | 317 'imc', |
| 315 'container', | 318 'container', |
| 316 'nacl_fault_inject', | 319 'nacl_fault_inject', |
| 317 'platform', | 320 'platform', |
| 318 'platform_qual_lib', | 321 'platform_qual_lib', |
| 319 VALIDATOR_LIB, | 322 ] + VALIDATOR_LIBS + DEBUG_LIBS |
| 320 ] + DEBUG_LIBS | |
| 321 if ((not env.Bit('coverage_enabled') or not env.Bit('windows')) and | 323 if ((not env.Bit('coverage_enabled') or not env.Bit('windows')) and |
| 322 not env.CrossToolsBuild()): | 324 not env.CrossToolsBuild()): |
| 323 sel_main_objs = [env.ComponentObject('sel_main.c')] + r_debug_objs | 325 sel_main_objs = [env.ComponentObject('sel_main.c')] + r_debug_objs |
| 324 SEL_LDR_NODE = env.ComponentProgram('sel_ldr', sel_main_objs, | 326 SEL_LDR_NODE = env.ComponentProgram('sel_ldr', sel_main_objs, |
| 325 EXTRA_LIBS=sel_ldr_libs) | 327 EXTRA_LIBS=sel_ldr_libs) |
| 326 if env.Bit('mac'): | 328 if env.Bit('mac'): |
| 327 # This target exists only to check that the service_runtime code | 329 # This target exists only to check that the service_runtime code |
| 328 # can successfully be linked into a Mac OS X dynamic library. Our | 330 # can successfully be linked into a Mac OS X dynamic library. Our |
| 329 # assembly code needs to be PIC-friendly and linkable in this | 331 # assembly code needs to be PIC-friendly and linkable in this |
| 330 # context, because it is linked into a dynamic library inside | 332 # context, because it is linked into a dynamic library inside |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 454 'simple_service', | 456 'simple_service', |
| 455 'thread_interface', | 457 'thread_interface', |
| 456 'gio_wrapped_desc', | 458 'gio_wrapped_desc', |
| 457 'nonnacl_srpc', | 459 'nonnacl_srpc', |
| 458 'nrd_xfer', | 460 'nrd_xfer', |
| 459 'nacl_perf_counter', | 461 'nacl_perf_counter', |
| 460 'nacl_base', | 462 'nacl_base', |
| 461 'imc', | 463 'imc', |
| 462 'nacl_fault_inject', | 464 'nacl_fault_inject', |
| 463 'platform', | 465 'platform', |
| 464 VALIDATOR_LIB, | 466 ] + VALIDATOR_LIBS + DEBUG_LIBS) |
| 465 ] + DEBUG_LIBS) | |
| 466 gtest_env.Requires(unit_tests_exe, crt) | 467 gtest_env.Requires(unit_tests_exe, crt) |
| 467 | 468 |
| 468 node = gtest_env.CommandTest( | 469 node = gtest_env.CommandTest( |
| 469 'gtest_output.xml.out', | 470 'gtest_output.xml.out', |
| 470 command=[unit_tests_exe, '--gtest_output=xml:${TARGET}']) | 471 command=[unit_tests_exe, '--gtest_output=xml:${TARGET}']) |
| 471 gtest_env.AddNodeToTestSuite(node, ['small_tests'], | 472 gtest_env.AddNodeToTestSuite(node, ['small_tests'], |
| 472 'run_service_runtime_tests') | 473 'run_service_runtime_tests') |
| 473 | 474 |
| 474 | 475 |
| 475 if not env.Bit('coverage_enabled') or not env.Bit('windows'): | 476 if not env.Bit('coverage_enabled') or not env.Bit('windows'): |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 511 'simple_service', | 512 'simple_service', |
| 512 'thread_interface', | 513 'thread_interface', |
| 513 'gio_wrapped_desc', | 514 'gio_wrapped_desc', |
| 514 'nonnacl_srpc', | 515 'nonnacl_srpc', |
| 515 'nrd_xfer', | 516 'nrd_xfer', |
| 516 'nacl_perf_counter', | 517 'nacl_perf_counter', |
| 517 'nacl_base', | 518 'nacl_base', |
| 518 'imc', | 519 'imc', |
| 519 'nacl_fault_inject', | 520 'nacl_fault_inject', |
| 520 'platform', | 521 'platform', |
| 521 VALIDATOR_LIB, | 522 ] + VALIDATOR_LIBS + DEBUG_LIBS) |
| 522 ] + DEBUG_LIBS) | |
| 523 env.Requires(mmap_test_exe, crt) | 523 env.Requires(mmap_test_exe, crt) |
| 524 | 524 |
| 525 mmap_test_file = env.File(arch_testdata_dir + '/hello_world.nexe') | 525 mmap_test_file = env.File(arch_testdata_dir + '/hello_world.nexe') |
| 526 bootstrap, bootstrap_arg = env.GetBootstrap() | 526 bootstrap, bootstrap_arg = env.GetBootstrap() |
| 527 if bootstrap is None: | 527 if bootstrap is None: |
| 528 mmap_test_command = [mmap_test_exe, mmap_test_file] | 528 mmap_test_command = [mmap_test_exe, mmap_test_file] |
| 529 else: | 529 else: |
| 530 mmap_test_command = [bootstrap, mmap_test_exe, | 530 mmap_test_command = [bootstrap, mmap_test_exe, |
| 531 bootstrap_arg, mmap_test_file] | 531 bootstrap_arg, mmap_test_file] |
| 532 | 532 |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 554 'simple_service', | 554 'simple_service', |
| 555 'thread_interface', | 555 'thread_interface', |
| 556 'gio_wrapped_desc', | 556 'gio_wrapped_desc', |
| 557 'nonnacl_srpc', | 557 'nonnacl_srpc', |
| 558 'nrd_xfer', | 558 'nrd_xfer', |
| 559 'nacl_perf_counter', | 559 'nacl_perf_counter', |
| 560 'nacl_base', | 560 'nacl_base', |
| 561 'imc', | 561 'imc', |
| 562 'nacl_fault_inject', | 562 'nacl_fault_inject', |
| 563 'platform', | 563 'platform', |
| 564 VALIDATOR_LIB, | 564 ] + VALIDATOR_LIBS + DEBUG_LIBS) |
| 565 ] + DEBUG_LIBS) | |
| 566 env.Requires(nacl_sync_cond_test_exe, crt) | 565 env.Requires(nacl_sync_cond_test_exe, crt) |
| 567 node = env.CommandTest( | 566 node = env.CommandTest( |
| 568 'nacl_sync_cond_test.out', | 567 'nacl_sync_cond_test.out', |
| 569 command=[nacl_sync_cond_test_exe]) | 568 command=[nacl_sync_cond_test_exe]) |
| 570 env.AddNodeToTestSuite(node, | 569 env.AddNodeToTestSuite(node, |
| 571 ['medium_tests'], | 570 ['medium_tests'], |
| 572 'run_nacl_sync_cond_test', | 571 'run_nacl_sync_cond_test', |
| 573 is_broken=is_broken) | 572 is_broken=is_broken) |
| 574 | 573 |
| 575 | 574 |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 748 if env.Bit('target_x86_64') and not env.CrossToolsBuild(): | 747 if env.Bit('target_x86_64') and not env.CrossToolsBuild(): |
| 749 node = env.CommandSelLdrTestNacl( | 748 node = env.CommandSelLdrTestNacl( |
| 750 'hello_x32.out', | 749 'hello_x32.out', |
| 751 env.File(os.path.join(arch_testdata_dir, 'hello_x32.nexe')), | 750 env.File(os.path.join(arch_testdata_dir, 'hello_x32.nexe')), |
| 752 stdout_golden=env.File(os.path.join('${MAIN_DIR}', | 751 stdout_golden=env.File(os.path.join('${MAIN_DIR}', |
| 753 'tests/hello_world', | 752 'tests/hello_world', |
| 754 'hello_world.stdout')) | 753 'hello_world.stdout')) |
| 755 ) | 754 ) |
| 756 env.AddNodeToTestSuite(node, ['small_tests'], 'run_hello_x32_test') | 755 env.AddNodeToTestSuite(node, ['small_tests'], 'run_hello_x32_test') |
| 757 | 756 |
| 757 # Test canned hello_world binary with validator_ragel. | |
| 758 # TODO(pasko): enable on x86-32 when the validator is updated to accept the | |
| 759 # binary. | |
| 760 if env.Bit('target_x86_64'): | |
| 761 node = env.CommandSelLdrTestNacl( | |
| 762 'dfa_hwd.out', | |
| 763 env.File(arch_testdata_dir + '/hello_world.nexe'), | |
| 764 stdout_golden = env.File('testdata/hello_world.stdout'), | |
| 765 stderr_golden = env.File('testdata/dfa_validator_hello.stderr'), | |
| 766 filter_regex = '"^(Hello, World!)$|DANGER"', | |
| 767 osenv='NACL_DANGEROUS_USE_DFA_VALIDATOR=1', | |
| 768 ) | |
| 769 env.AddNodeToTestSuite(node, ['medium_tests'], | |
|
Nick Bray
2012/04/19 23:11:08
Also add to suite validator_tests ?
pasko-google - do not use
2012/04/20 14:30:38
Yeah, why not. Done.
| |
| 770 'run_dfa_validator_hello_world_test') | |
| 771 | |
| 758 # ---------------------------------------------------------- | 772 # ---------------------------------------------------------- |
| 759 # Integration Tests | 773 # Integration Tests |
| 760 # ---------------------------------------------------------- | 774 # ---------------------------------------------------------- |
| 761 | 775 |
| 762 # Doesn't work on windows under coverage. | 776 # Doesn't work on windows under coverage. |
| 763 # TODO(bradnelson): fix this to work on windows under coverage. | 777 # TODO(bradnelson): fix this to work on windows under coverage. |
| 764 # NOTE: uses validator | 778 # NOTE: uses validator |
| 765 if ((not env.Bit('windows') or not env.Bit('coverage_enabled')) and | 779 if ((not env.Bit('windows') or not env.Bit('coverage_enabled')) and |
| 766 not env.CrossToolsBuild()): | 780 not env.CrossToolsBuild()): |
| 767 obj_proxy_test_inputs = [ 'fs/obj_proxy_test.c', ] | 781 obj_proxy_test_inputs = [ 'fs/obj_proxy_test.c', ] |
| 768 obj_proxy_test = env.ComponentProgram( | 782 obj_proxy_test = env.ComponentProgram( |
| 769 'obj_proxy_test', | 783 'obj_proxy_test', |
| 770 obj_proxy_test_inputs, | 784 obj_proxy_test_inputs, |
| 771 EXTRA_LIBS=['sel', | 785 EXTRA_LIBS=['sel', |
| 772 'env_cleanser', | 786 'env_cleanser', |
| 773 'manifest_proxy', | 787 'manifest_proxy', |
| 774 'simple_service', | 788 'simple_service', |
| 775 'thread_interface', | 789 'thread_interface', |
| 776 'gio_wrapped_desc', | 790 'gio_wrapped_desc', |
| 777 'nonnacl_srpc', | 791 'nonnacl_srpc', |
| 778 'nrd_xfer', | 792 'nrd_xfer', |
| 779 'nacl_perf_counter', | 793 'nacl_perf_counter', |
| 780 'nacl_base', | 794 'nacl_base', |
| 781 'imc', | 795 'imc', |
| 782 'nacl_fault_inject', | 796 'nacl_fault_inject', |
| 783 'platform', | 797 'platform', |
| 784 'nacl_xdr', | 798 'nacl_xdr', |
| 785 'container', | 799 'container', |
| 786 VALIDATOR_LIB, | 800 ] + VALIDATOR_LIBS + DEBUG_LIBS) |
| 787 ] + DEBUG_LIBS) | |
| 788 | 801 |
| 789 node = env.CommandTest( | 802 node = env.CommandTest( |
| 790 'obj_proxy_test.out', | 803 'obj_proxy_test.out', |
| 791 # NOTE: this is run out of obj/ rather than staging/ | 804 # NOTE: this is run out of obj/ rather than staging/ |
| 792 [obj_proxy_test, '-n', '2048'], | 805 [obj_proxy_test, '-n', '2048'], |
| 793 size='huge') | 806 size='huge') |
| 794 # TODO(bsy): change this test to use less time -- most of it (on windows) | 807 # TODO(bsy): change this test to use less time -- most of it (on windows) |
| 795 # is in the RNG, so with this will inherently speed up when the RNG is | 808 # is in the RNG, so with this will inherently speed up when the RNG is |
| 796 # updated. | 809 # updated. |
| 797 | 810 |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 927 'simple_service', | 940 'simple_service', |
| 928 'thread_interface', | 941 'thread_interface', |
| 929 'gio_wrapped_desc', | 942 'gio_wrapped_desc', |
| 930 'nonnacl_srpc', | 943 'nonnacl_srpc', |
| 931 'nrd_xfer', | 944 'nrd_xfer', |
| 932 'nacl_perf_counter', | 945 'nacl_perf_counter', |
| 933 'nacl_base', | 946 'nacl_base', |
| 934 'imc', | 947 'imc', |
| 935 'nacl_fault_inject', | 948 'nacl_fault_inject', |
| 936 'platform', | 949 'platform', |
| 937 VALIDATOR_LIB, | 950 ] + VALIDATOR_LIBS + DEBUG_LIBS) |
| 938 ] + DEBUG_LIBS) | |
| 939 | 951 |
| 940 # NaClAbort() behaves differently when code coverage is enabled: it | 952 # NaClAbort() behaves differently when code coverage is enabled: it |
| 941 # calls exit() rather than abort(). | 953 # calls exit() rather than abort(). |
| 942 if env.Bit('coverage_enabled'): | 954 if env.Bit('coverage_enabled'): |
| 943 expected_exit_status = 'naclabort_coverage' | 955 expected_exit_status = 'naclabort_coverage' |
| 944 else: | 956 else: |
| 945 expected_exit_status = 'sigabrt' | 957 expected_exit_status = 'sigabrt' |
| 946 node = env.CommandTest( | 958 node = env.CommandTest( |
| 947 'sel_ldr_thread_death_test.out', | 959 'sel_ldr_thread_death_test.out', |
| 948 command=[sel_ldr_thread_death_test_exe], | 960 command=[sel_ldr_thread_death_test_exe], |
| 949 exit_status=expected_exit_status) | 961 exit_status=expected_exit_status) |
| 950 | 962 |
| 951 # TODO(tuduce): Make it work on windows. | 963 # TODO(tuduce): Make it work on windows. |
| 952 env.AddNodeToTestSuite(node, ['medium_tests'], | 964 env.AddNodeToTestSuite(node, ['medium_tests'], |
| 953 'run_sel_ldr_thread_death_test', | 965 'run_sel_ldr_thread_death_test', |
| 954 is_broken=env.Bit('windows')) | 966 is_broken=env.Bit('windows')) |
| 955 | 967 |
| 956 | 968 |
| 957 # This currently tests linking of sel_main_chrome.c *only*. We do not | 969 # This currently tests linking of sel_main_chrome.c *only*. We do not |
| 958 # expect this program to do anything meaningful when run. | 970 # expect this program to do anything meaningful when run. |
| 959 env.ComponentProgram('sel_main_chrome_test', ['sel_main_chrome_test.c'], | 971 env.ComponentProgram('sel_main_chrome_test', ['sel_main_chrome_test.c'], |
| 960 EXTRA_LIBS=sel_ldr_libs) | 972 EXTRA_LIBS=sel_ldr_libs) |
| OLD | NEW |