Changeset 76045 in webkit


Ignore:
Timestamp:
Jan 18, 2011 12:32:22 PM (13 years ago)
Author:
dpranke@chromium.org
Message:

2011-01-18 Dirk Pranke <dpranke@chromium.org>

Reviewed by Mihai Parparita.

new-run-webkit-tests shouldn't crash when you try to run a
directory containing only skipped files.

https://bugs.webkit.org/show_bug.cgi?id=52478

  • Scripts/webkitpy/layout_tests/layout_package/test_runner.py:
  • Scripts/webkitpy/layout_tests/port/test.py:
  • Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
Location:
trunk/Tools
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r76031 r76045  
     12011-01-18  Dirk Pranke  <dpranke@chromium.org>
     2
     3        Reviewed by Mihai Parparita.
     4
     5        new-run-webkit-tests shouldn't crash when you try to run a
     6        directory containing only skipped files.
     7
     8        https://bugs.webkit.org/show_bug.cgi?id=52478
     9       
     10        * Scripts/webkitpy/layout_tests/layout_package/test_runner.py:
     11        * Scripts/webkitpy/layout_tests/port/test.py:
     12        * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
     13
    1142011-01-18  Adam Bergkvist  <adam.bergkvist@ericsson.com> and Martin Robinson  <mrobinson@igalia.com>
    215
  • trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/test_runner.py

    r75626 r76045  
    200200
    201201        """
    202         paths = [self._strip_test_dir_prefix(arg) for arg in args if arg and arg != '']
     202        paths = self._strip_test_dir_prefixes(args)
    203203        paths += last_unexpected_results
    204204        if self._options.test_list:
    205             paths += read_test_files(self._options.test_list)
     205            paths += self._strip_test_dir_prefixes(read_test_files(self._options.test_list))
    206206        self._test_files = self._port.tests(paths)
     207
     208    def _strip_test_dir_prefixes(self, paths):
     209        return [self._strip_test_dir_prefix(path) for path in paths if path]
    207210
    208211    def _strip_test_dir_prefix(self, path):
     
    390393                result_summary.add(result, expected=True)
    391394        self._printer.print_expected('')
     395
     396        # Check to make sure we didn't filter out all of the tests.
     397        if not len(self._test_files):
     398            _log.info("All tests are being skipped")
     399            return None
    392400
    393401        return result_summary
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/test.py

    r75626 r76045  
    214214    def layout_tests_dir(self):
    215215        return self.path_from_webkit_base('Tools', 'Scripts',
    216                                           'webkitpy', 'layout_tests', 'data')
     216                                          'webkitpy', 'layout_tests', 'data', 'LayoutTests')
    217217
    218218    def path_isdir(self, path):
  • trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py

    r74525 r76045  
    316316        self.assertEquals(['passes/text.html'], tests_run)
    317317
     318    def test_single_file_with_prefix(self):
     319        tests_run = get_tests_run(['LayoutTests/passes/text.html'], tests_included=True, flatten_batches=True)
     320        self.assertEquals(['passes/text.html'], tests_run)
     321
     322    def test_single_skipped_file(self):
     323        tests_run = get_tests_run(['failures/expected/keybaord.html'], tests_included=True, flatten_batches=True)
     324        self.assertEquals([], tests_run)
     325
    318326    def test_test_list(self):
    319327        filename = tempfile.mktemp()
     
    328336        self.assertEqual(res, -1)
    329337        self.assertFalse(err.empty())
     338
     339    def test_test_list_with_prefix(self):
     340        filename = tempfile.mktemp()
     341        tmpfile = file(filename, mode='w+')
     342        tmpfile.write('LayoutTests/passes/text.html')
     343        tmpfile.close()
     344        tests_run = get_tests_run(['--test-list=%s' % filename], tests_included=True, flatten_batches=True)
     345        self.assertEquals(['passes/text.html'], tests_run)
    330346
    331347    def test_unexpected_failures(self):
Note: See TracChangeset for help on using the changeset viewer.