| OLD | NEW |
| 1 # -*- python -*- | 1 # -*- python -*- |
| 2 # Copyright (c) 2011 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2011 The Native Client Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 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 | 7 |
| 8 Import('env') | 8 Import('env') |
| 9 | 9 |
| 10 # TODO(robertm): consider adding this to the top level scons files | 10 # TODO(robertm): consider adding this to the top level scons files |
| (...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 604 command=[nacl_tls_unittest]) | 604 command=[nacl_tls_unittest]) |
| 605 | 605 |
| 606 # Note that this test hangs in pthread_join() on ARM QEMU. | 606 # Note that this test hangs in pthread_join() on ARM QEMU. |
| 607 is_broken = env.Bit('target_arm') and env.UsingEmulator() | 607 is_broken = env.Bit('target_arm') and env.UsingEmulator() |
| 608 env.AddNodeToTestSuite(node, ['small_tests'], 'run_nacl_tls_unittest', | 608 env.AddNodeToTestSuite(node, ['small_tests'], 'run_nacl_tls_unittest', |
| 609 is_broken=is_broken) | 609 is_broken=is_broken) |
| 610 | 610 |
| 611 # Test that sel_ldr does not crash if the executable file cannot be opened. | 611 # Test that sel_ldr does not crash if the executable file cannot be opened. |
| 612 node = env.CommandSelLdrTestNacl( | 612 node = env.CommandSelLdrTestNacl( |
| 613 'sel_ldr_exe_not_found.out', | 613 'sel_ldr_exe_not_found.out', |
| 614 command=['name_of_file_that_does_not_exist.nexe'], | 614 'name_of_file_that_does_not_exist.nexe', |
| 615 exit_status='1') | 615 exit_status='1') |
| 616 env.AddNodeToTestSuite(node, ['small_tests'], 'run_sel_ldr_exe_not_found_test') | 616 env.AddNodeToTestSuite(node, ['small_tests'], 'run_sel_ldr_exe_not_found_test') |
| 617 | 617 |
| 618 # ---------------------------------------------------------- | 618 # ---------------------------------------------------------- |
| 619 # Small tests with canned binaries | 619 # Small tests with canned binaries |
| 620 # ---------------------------------------------------------- | 620 # ---------------------------------------------------------- |
| 621 | 621 |
| 622 # Do not run when building tools to run on x86-32 but to analyze the | 622 # Do not run when building tools to run on x86-32 but to analyze the |
| 623 # arm instruction set | 623 # arm instruction set |
| 624 if not env.CrossToolsBuild(): | 624 if not env.CrossToolsBuild(): |
| 625 node = env.CommandSelLdrTestNacl( | 625 node = env.CommandSelLdrTestNacl( |
| 626 'fuzz_nullptr_test.out', | 626 'fuzz_nullptr_test.out', |
| 627 env.File(arch_testdata_dir + '/nullptr.nexe'), |
| 627 sel_ldr_flags=['-F'], | 628 sel_ldr_flags=['-F'], |
| 628 command = [env.File(arch_testdata_dir + '/nullptr.nexe')], | |
| 629 exit_status = '0') | 629 exit_status = '0') |
| 630 env.AddNodeToTestSuite(node, ['small_tests'], 'run_fuzz_nullptr_test') | 630 env.AddNodeToTestSuite(node, ['small_tests'], 'run_fuzz_nullptr_test') |
| 631 | 631 |
| 632 # ---------------------------------------------------------- | 632 # ---------------------------------------------------------- |
| 633 # Integration Tests | 633 # Integration Tests |
| 634 # ---------------------------------------------------------- | 634 # ---------------------------------------------------------- |
| 635 | 635 |
| 636 # Doesn't work on windows under coverage. | 636 # Doesn't work on windows under coverage. |
| 637 # TODO(bradnelson): fix this to work on windows under coverage. | 637 # TODO(bradnelson): fix this to work on windows under coverage. |
| 638 # NOTE: uses validator | 638 # NOTE: uses validator |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 689 INTEGRATION_TESTS_X86_STDIN_OUT = ['$SCONSTRUCT_DIR/tests/mandel/test', | 689 INTEGRATION_TESTS_X86_STDIN_OUT = ['$SCONSTRUCT_DIR/tests/mandel/test', |
| 690 '$SCONSTRUCT_DIR/tests/fib/fib_scalar_test', | 690 '$SCONSTRUCT_DIR/tests/fib/fib_scalar_test', |
| 691 '$SCONSTRUCT_DIR/tests/fib/fib_array_test' ] | 691 '$SCONSTRUCT_DIR/tests/fib/fib_array_test' ] |
| 692 | 692 |
| 693 def AddIntegrationTest(test, location): | 693 def AddIntegrationTest(test, location): |
| 694 if not test or not location: | 694 if not test or not location: |
| 695 return; | 695 return; |
| 696 | 696 |
| 697 node = env.SelUniversalTest( | 697 node = env.SelUniversalTest( |
| 698 test + '_canned.out', | 698 test + '_canned.out', |
| 699 command = [env.File(arch_testdata_dir + '/' + test + '.nexe')], | 699 env.File(arch_testdata_dir + '/' + test + '.nexe'), |
| 700 stdin = location + '.stdin', | 700 stdin = location + '.stdin', |
| 701 stdout_golden = location + '.stdout', | 701 stdout_golden = location + '.stdout', |
| 702 ) | 702 ) |
| 703 env.AddNodeToTestSuite(node, | 703 env.AddNodeToTestSuite(node, |
| 704 ['medium_tests'], | 704 ['medium_tests'], |
| 705 'run_%s_integration_test' % test) | 705 'run_%s_integration_test' % test) |
| 706 | 706 |
| 707 if env.Bit('target_x86'): | 707 if env.Bit('target_x86'): |
| 708 RE_HELLO = '^(Hello, World!)$' | 708 RE_HELLO = '^(Hello, World!)$' |
| 709 RE_IDENT = '^\[[0-9,:.]*\] (e_ident\+1 = ELF)$' | 709 RE_IDENT = '^\[[0-9,:.]*\] (e_ident\+1 = ELF)$' |
| 710 | 710 |
| 711 node = env.CommandSelLdrTestNacl( | 711 node = env.CommandSelLdrTestNacl( |
| 712 'nacl_log.out', | 712 'nacl_log.out', |
| 713 command = [env.File(arch_testdata_dir + '/hello_world.nexe')], | 713 env.File(arch_testdata_dir + '/hello_world.nexe'), |
| 714 log_golden = env.File('testdata/hello_world.log'), | 714 log_golden = env.File('testdata/hello_world.log'), |
| 715 stdout_golden = env.File('testdata/hello_world.stdout'), | 715 stdout_golden = env.File('testdata/hello_world.stdout'), |
| 716 filter_regex = '"' + RE_HELLO + '|' + RE_IDENT + '"', | 716 filter_regex = '"' + RE_HELLO + '|' + RE_IDENT + '"', |
| 717 filter_group_only = 'true', | 717 filter_group_only = 'true', |
| 718 ) | 718 ) |
| 719 env.AddNodeToTestSuite(node, ['medium_tests']) | 719 env.AddNodeToTestSuite(node, ['medium_tests']) |
| 720 | 720 |
| 721 assert len(INTEGRATION_TESTS_X86) == len(INTEGRATION_TESTS_X86_STDIN_OUT) | 721 assert len(INTEGRATION_TESTS_X86) == len(INTEGRATION_TESTS_X86_STDIN_OUT) |
| 722 map(AddIntegrationTest, | 722 map(AddIntegrationTest, |
| 723 INTEGRATION_TESTS_X86, | 723 INTEGRATION_TESTS_X86, |
| (...skipping 22 matching lines...) Expand all Loading... |
| 746 def AddDeathTest(test, skip): | 746 def AddDeathTest(test, skip): |
| 747 if not test: | 747 if not test: |
| 748 return; | 748 return; |
| 749 | 749 |
| 750 if test in skip: | 750 if test in skip: |
| 751 print 'SKIPPING test ', test | 751 print 'SKIPPING test ', test |
| 752 return; | 752 return; |
| 753 | 753 |
| 754 node = env.CommandSelLdrTestNacl( | 754 node = env.CommandSelLdrTestNacl( |
| 755 test + '.out', | 755 test + '.out', |
| 756 command = [env.File(arch_testdata_dir + '/' + test + '.nexe')], | 756 env.File(arch_testdata_dir + '/' + test + '.nexe'), |
| 757 stderr_golden = env.File('testdata/' + test + '.stderr'), | 757 stderr_golden = env.File('testdata/' + test + '.stderr'), |
| 758 filter_regex = ERROR_WHILE_LOADING, | 758 filter_regex = ERROR_WHILE_LOADING, |
| 759 filter_group_only = 'true', | 759 filter_group_only = 'true', |
| 760 exit_status = '1') | 760 exit_status = '1') |
| 761 env.AddNodeToTestSuite(node, ['medium_tests']) | 761 env.AddNodeToTestSuite(node, ['medium_tests']) |
| 762 | 762 |
| 763 | 763 |
| 764 if env.Bit('target_x86'): | 764 if env.Bit('target_x86'): |
| 765 # built in tests/nullptr/ | 765 # built in tests/nullptr/ |
| 766 node = env.CommandSelLdrTestNacl( | 766 node = env.CommandSelLdrTestNacl( |
| 767 'nullptr.out', | 767 'nullptr.out', |
| 768 command=[env.File(arch_testdata_dir + '/nullptr.nexe')], | 768 env.File(arch_testdata_dir + '/nullptr.nexe'), |
| 769 exit_status='untrusted_segfault') | 769 exit_status='untrusted_segfault') |
| 770 env.AddNodeToTestSuite(node, ['medium_tests']) | 770 env.AddNodeToTestSuite(node, ['medium_tests']) |
| 771 | 771 |
| 772 if env.Bit('build_x86_32'): | 772 if env.Bit('build_x86_32'): |
| 773 skip = NOT_AVAIL_X86_32 | 773 skip = NOT_AVAIL_X86_32 |
| 774 else: | 774 else: |
| 775 skip = NOT_AVAIL_X86_64 | 775 skip = NOT_AVAIL_X86_64 |
| 776 | 776 |
| 777 for death_test in DEATH_TESTS_X86: | 777 for death_test in DEATH_TESTS_X86: |
| 778 AddDeathTest(death_test, skip) | 778 AddDeathTest(death_test, skip) |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 810 expected_exit_status = 'sigabrt' | 810 expected_exit_status = 'sigabrt' |
| 811 node = env.CommandTest( | 811 node = env.CommandTest( |
| 812 'sel_ldr_thread_death_test.out', | 812 'sel_ldr_thread_death_test.out', |
| 813 command=[sel_ldr_thread_death_test_exe], | 813 command=[sel_ldr_thread_death_test_exe], |
| 814 exit_status=expected_exit_status) | 814 exit_status=expected_exit_status) |
| 815 | 815 |
| 816 # TODO(tuduce): Make it work on windows. | 816 # TODO(tuduce): Make it work on windows. |
| 817 env.AddNodeToTestSuite(node, ['medium_tests'], | 817 env.AddNodeToTestSuite(node, ['medium_tests'], |
| 818 'run_sel_ldr_thread_death_test', | 818 'run_sel_ldr_thread_death_test', |
| 819 is_broken=env.Bit('windows')) | 819 is_broken=env.Bit('windows')) |
| OLD | NEW |