Changeset 76288 in webkit


Ignore:
Timestamp:
Jan 20, 2011 3:05:30 PM (13 years ago)
Author:
dpranke@chromium.org
Message:

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

Reviewed by Eric Seidel.

nrwt: remove fs refs from printing, test_failures, test_expectations, text_diff

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

  • Scripts/webkitpy/layout_tests/layout_package/printing.py:
  • Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py:
  • Scripts/webkitpy/layout_tests/layout_package/test_expectations.py:
  • Scripts/webkitpy/layout_tests/layout_package/test_expectations_unittest.py:
  • Scripts/webkitpy/layout_tests/layout_package/test_failures.py:
  • Scripts/webkitpy/layout_tests/test_types/text_diff.py:
Location:
trunk/Tools
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r76286 r76288  
     12011-01-20  Dirk Pranke  <dpranke@chromium.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        nrwt: remove fs refs from printing, test_failures, test_expectations, text_diff
     6
     7        https://bugs.webkit.org/show_bug.cgi?id=52756
     8
     9        * Scripts/webkitpy/layout_tests/layout_package/printing.py:
     10        * Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py:
     11        * Scripts/webkitpy/layout_tests/layout_package/test_expectations.py:
     12        * Scripts/webkitpy/layout_tests/layout_package/test_expectations_unittest.py:
     13        * Scripts/webkitpy/layout_tests/layout_package/test_failures.py:
     14        * Scripts/webkitpy/layout_tests/test_types/text_diff.py:
     15
    1162011-01-20  Mansi Mithal  <mansi.mithal@nokia.com>
    217
  • trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/printing.py

    r72708 r76288  
    3232import logging
    3333import optparse
    34 import os
    35 import pdb
    3634
    3735from webkitpy.layout_tests.layout_package import metered_stream
     
    412410
    413411        next_test = test_list[self._current_test_number]
    414         next_dir = os.path.dirname(
     412        next_dir = self._port._filesystem.dirname(
    415413            self._port.relative_test_filename(next_test))
    416414        if self._current_progress_str == "":
     
    438436
    439437            next_test = test_list[self._current_test_number]
    440             next_dir = os.path.dirname(
     438            next_dir = self._port._filesystem.dirname(
    441439                self._port.relative_test_filename(next_test))
    442440
  • trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py

    r75626 r76288  
    3030"""Unit tests for printing.py."""
    3131
    32 import os
    3332import optparse
    34 import pdb
    35 import sys
    3633import unittest
    3734import logging
     
    139136        elif result_type == test_expectations.CRASH:
    140137            failures = [test_failures.FailureCrash()]
    141         path = os.path.join(self._port.layout_tests_dir(), test)
     138        path = self._port._filesystem.join(self._port.layout_tests_dir(), test)
    142139        return test_results.TestResult(path, failures=failures, test_run_time=run_time)
    143140
    144141    def get_result_summary(self, tests, expectations_str):
    145         test_paths = [os.path.join(self._port.layout_tests_dir(), test) for
     142        test_paths = [self._port._filesystem.join(self._port.layout_tests_dir(), test) for
    146143                      test in tests]
    147144        expectations = test_expectations.TestExpectations(
  • trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/test_expectations.py

    r75626 r76288  
    3333
    3434import logging
    35 import os
    3635import re
    37 import sys
    3836
    3937import webkitpy.thirdparty.simplejson as simplejson
     
    323321
    324322        self._port = port
     323        self._fs = port._filesystem
    325324        self._expectations = expectations
    326325        self._full_test_list = full_test_list
     
    691690                    test_list_path)
    692691
    693             full_path = os.path.join(self._port.layout_tests_dir(),
    694                                      test_list_path)
    695             full_path = os.path.normpath(full_path)
     692            full_path = self._fs.join(self._port.layout_tests_dir(),
     693                                      test_list_path)
     694            full_path = self._fs.normpath(full_path)
    696695            # WebKit's way of skipping tests is to add a -disabled suffix.
    697696            # So we should consider the path existing if the path or the
     
    737736        # files and nodes being categories.
    738737
    739         path = os.path.join(self._port.layout_tests_dir(), test_list_path)
    740         path = os.path.normpath(path)
    741         if self._port.path_isdir(path):
     738        path = self._fs.join(self._port.layout_tests_dir(), test_list_path)
     739        path = self._fs.normpath(path)
     740        if self._fs.isdir(path):
    742741            # this is a test category, return all the tests of the category.
    743             path = os.path.join(path, '')
     742            path = self._fs.join(path, '')
    744743
    745744            return [test for test in self._full_test_list if test.startswith(path)]
     
    818817            self._remove_from_sets(test, self._result_type_to_tests)
    819818
    820         self._test_list_paths[test] = os.path.normpath(test_list_path)
     819        self._test_list_paths[test] = self._fs.normpath(test_list_path)
    821820
    822821    def _remove_from_sets(self, test, dict):
     
    839838
    840839        prev_base_path = self._test_list_paths[test]
    841         if (prev_base_path == os.path.normpath(test_list_path)):
     840        if (prev_base_path == self._fs.normpath(test_list_path)):
    842841            if (not allow_overrides or test in self._overridding_tests):
    843842                if allow_overrides:
     
    855854
    856855        # Check if we've already seen a more precise path.
    857         return prev_base_path.startswith(os.path.normpath(test_list_path))
     856        return prev_base_path.startswith(self._fs.normpath(test_list_path))
    858857
    859858    def _add_error(self, lineno, msg, path):
  • trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/test_expectations_unittest.py

    r75626 r76288  
    3030"""Unit tests for test_expectations.py."""
    3131
    32 import os
    33 import sys
    3432import unittest
    3533
     
    8381    def __init__(self, testFunc, setUp=None, tearDown=None, description=None):
    8482        self._port = port.get('test', None)
     83        self._fs = self._port._filesystem
    8584        self._exp = None
    8685        unittest.TestCase.__init__(self, testFunc)
    8786
    8887    def get_test(self, test_name):
    89         return os.path.join(self._port.layout_tests_dir(), test_name)
     88        return self._fs.join(self._port.layout_tests_dir(), test_name)
    9089
    9190    def get_basic_tests(self):
  • trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/test_failures.py

    r75332 r76288  
    3030"""Classes for failures that occur during tests."""
    3131
    32 import os
    3332import test_expectations
    3433
     
    122121          The relative windows path to the output filename
    123122        """
    124         return os.path.splitext(filename)[0] + modifier
     123        # FIXME: technically this breaks if files don't use ".ext" to indicate
     124        # the extension, but passing in a Filesystem object here is a huge
     125        # hassle.
     126        return filename[filename.rfind('.')] + modifier
    125127
    126128
  • trunk/Tools/Scripts/webkitpy/layout_tests/test_types/text_diff.py

    r74362 r76288  
    3434"""
    3535
    36 from __future__ import with_statement
    37 
    38 import codecs
    3936import errno
    4037import logging
    41 import os.path
    4238
    4339from webkitpy.layout_tests.layout_package import test_failures
Note: See TracChangeset for help on using the changeset viewer.