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 atexit | 6 import atexit |
7 import glob | 7 import glob |
8 import os | 8 import os |
9 import platform | 9 import platform |
10 import shutil | 10 import shutil |
(...skipping 1522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1533 filter_group_only = params.get('filter_group_only', False) | 1533 filter_group_only = params.get('filter_group_only', False) |
1534 post_actions.append( | 1534 post_actions.append( |
1535 GoldenFileCheckAction( | 1535 GoldenFileCheckAction( |
1536 env, stream_file, golden_file, | 1536 env, stream_file, golden_file, |
1537 filter_regex, filter_inverse, filter_group_only)) | 1537 filter_regex, filter_inverse, filter_group_only)) |
1538 | 1538 |
1539 if ShouldUseVerboseOptions(extra): | 1539 if ShouldUseVerboseOptions(extra): |
1540 env.MakeVerboseExtraOptions(target, log_verbosity, extra) | 1540 env.MakeVerboseExtraOptions(target, log_verbosity, extra) |
1541 # Heuristic for when to capture output... | 1541 # Heuristic for when to capture output... |
1542 capture_output = (extra.pop('capture_output', False) | 1542 capture_output = (extra.pop('capture_output', False) |
1543 or 'process_output' in extra) | 1543 or 'process_output_single' in extra) |
1544 node = env.CommandTest(target, | 1544 node = env.CommandTest(target, |
1545 command, | 1545 command, |
1546 # Set to 'huge' so that the browser tester's timeout | 1546 # Set to 'huge' so that the browser tester's timeout |
1547 # takes precedence over the default of the test_suite. | 1547 # takes precedence over the default of the test_suite. |
1548 size='huge', | 1548 size='huge', |
1549 capture_output=capture_output, | 1549 capture_output=capture_output, |
1550 **extra) | 1550 **extra) |
1551 # We can't check output if the test is not run. | 1551 # We can't check output if the test is not run. |
1552 if not env.Bit('do_not_run_tests'): | 1552 if not env.Bit('do_not_run_tests'): |
1553 for action in post_actions: | 1553 for action in post_actions: |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1805 log_file = env.MakeNaClLogOption(target) | 1805 log_file = env.MakeNaClLogOption(target) |
1806 extra['log_file'] = log_file | 1806 extra['log_file'] = log_file |
1807 extra_env = ['NACLLOG=%s' % log_file, | 1807 extra_env = ['NACLLOG=%s' % log_file, |
1808 'NACLVERBOSITY=%d' % log_verbosity] | 1808 'NACLVERBOSITY=%d' % log_verbosity] |
1809 extra['osenv'] = extra.get('osenv', []) + extra_env | 1809 extra['osenv'] = extra.get('osenv', []) + extra_env |
1810 | 1810 |
1811 pre_base_env.AddMethod(MakeVerboseExtraOptions) | 1811 pre_base_env.AddMethod(MakeVerboseExtraOptions) |
1812 | 1812 |
1813 def ShouldUseVerboseOptions(extra): | 1813 def ShouldUseVerboseOptions(extra): |
1814 """ Heuristic for setting up Verbose NACLLOG options. """ | 1814 """ Heuristic for setting up Verbose NACLLOG options. """ |
1815 return ('process_output' in extra or | 1815 return ('process_output_single' in extra or |
1816 'log_golden' in extra) | 1816 'log_golden' in extra) |
1817 | 1817 |
1818 # ---------------------------------------------------------- | 1818 # ---------------------------------------------------------- |
1819 DeclareBit('tests_use_irt', 'Non-browser tests also load the IRT image', False) | 1819 DeclareBit('tests_use_irt', 'Non-browser tests also load the IRT image', False) |
1820 | 1820 |
1821 def CommandSelLdrTestNacl(env, name, nexe, | 1821 def CommandSelLdrTestNacl(env, name, nexe, |
1822 args = None, | 1822 args = None, |
1823 log_verbosity=2, | 1823 log_verbosity=2, |
1824 sel_ldr_flags=None, | 1824 sel_ldr_flags=None, |
1825 loader=None, | 1825 loader=None, |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1885 env.Alias('irt_tests', node) | 1885 env.Alias('irt_tests', node) |
1886 return node | 1886 return node |
1887 | 1887 |
1888 pre_base_env.AddMethod(CommandSelLdrTestNacl) | 1888 pre_base_env.AddMethod(CommandSelLdrTestNacl) |
1889 | 1889 |
1890 # ---------------------------------------------------------- | 1890 # ---------------------------------------------------------- |
1891 TEST_EXTRA_ARGS = ['stdin', 'log_file', | 1891 TEST_EXTRA_ARGS = ['stdin', 'log_file', |
1892 'stdout_golden', 'stderr_golden', 'log_golden', | 1892 'stdout_golden', 'stderr_golden', 'log_golden', |
1893 'filter_regex', 'filter_inverse', 'filter_group_only', | 1893 'filter_regex', 'filter_inverse', 'filter_group_only', |
1894 'osenv', 'arch', 'subarch', 'exit_status', 'track_cmdtime', | 1894 'osenv', 'arch', 'subarch', 'exit_status', 'track_cmdtime', |
1895 'process_output', 'using_nacl_signal_handler'] | 1895 'num_runs', 'process_output_single', |
| 1896 'process_output_combined', 'using_nacl_signal_handler'] |
1896 | 1897 |
1897 TEST_TIME_THRESHOLD = { | 1898 TEST_TIME_THRESHOLD = { |
1898 'small': 2, | 1899 'small': 2, |
1899 'medium': 10, | 1900 'medium': 10, |
1900 'large': 60, | 1901 'large': 60, |
1901 'huge': 1800, | 1902 'huge': 1800, |
1902 } | 1903 } |
1903 | 1904 |
1904 # Valgrind handles SIGSEGV in a way our testing tools do not expect. | 1905 # Valgrind handles SIGSEGV in a way our testing tools do not expect. |
1905 UNSUPPORTED_VALGRIND_EXIT_STATUS = ['sigabrt', | 1906 UNSUPPORTED_VALGRIND_EXIT_STATUS = ['sigabrt', |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1997 assert flag_name in TEST_EXTRA_ARGS, repr(flag_name) | 1998 assert flag_name in TEST_EXTRA_ARGS, repr(flag_name) |
1998 if isinstance(flag_value, list): | 1999 if isinstance(flag_value, list): |
1999 # Options to command_tester.py which are actually lists must not be | 2000 # Options to command_tester.py which are actually lists must not be |
2000 # separated by whitespace. This stringifies the lists with a separator | 2001 # separated by whitespace. This stringifies the lists with a separator |
2001 # char to satisfy command_tester. | 2002 # char to satisfy command_tester. |
2002 flag_value = command_tester.StringifyList(flag_value) | 2003 flag_value = command_tester.StringifyList(flag_value) |
2003 # do not add --flag + |flag_name| |flag_value| if | 2004 # do not add --flag + |flag_name| |flag_value| if |
2004 # |flag_value| is false (empty). | 2005 # |flag_value| is false (empty). |
2005 if flag_value: | 2006 if flag_value: |
2006 script_flags.append('--' + flag_name) | 2007 script_flags.append('--' + flag_name) |
| 2008 # Make sure flag values are strings (or SCons objects) when building |
| 2009 # up the command. Right now, this only means convert ints to strings. |
| 2010 if isinstance(flag_value, int): |
| 2011 flag_value = str(flag_value) |
2007 script_flags.append(flag_value) | 2012 script_flags.append(flag_value) |
2008 | 2013 |
2009 # Other extra flags | 2014 # Other extra flags |
2010 if not capture_output: | 2015 if not capture_output: |
2011 script_flags.extend(['--capture_output', '0']) | 2016 script_flags.extend(['--capture_output', '0']) |
2012 | 2017 |
2013 test_script = env.File('${SCONSTRUCT_DIR}/tools/command_tester.py') | 2018 test_script = env.File('${SCONSTRUCT_DIR}/tools/command_tester.py') |
2014 command = ['${PYTHON}', test_script] + script_flags + command | 2019 command = ['${PYTHON}', test_script] + script_flags + command |
2015 return AutoDepsCommand(env, name, command, | 2020 return AutoDepsCommand(env, name, command, |
2016 extra_deps=extra_deps, posix_path=posix_path, | 2021 extra_deps=extra_deps, posix_path=posix_path, |
(...skipping 1626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3643 nacl_env.ValidateSdk() | 3648 nacl_env.ValidateSdk() |
3644 | 3649 |
3645 if BROKEN_TEST_COUNT > 0: | 3650 if BROKEN_TEST_COUNT > 0: |
3646 msg = "There are %d broken tests." % BROKEN_TEST_COUNT | 3651 msg = "There are %d broken tests." % BROKEN_TEST_COUNT |
3647 if GetOption('brief_comstr'): | 3652 if GetOption('brief_comstr'): |
3648 msg += " Add --verbose to the command line for more information." | 3653 msg += " Add --verbose to the command line for more information." |
3649 print msg | 3654 print msg |
3650 | 3655 |
3651 # separate warnings from actual build output | 3656 # separate warnings from actual build output |
3652 Banner('B U I L D - O U T P U T:') | 3657 Banner('B U I L D - O U T P U T:') |
OLD | NEW |