Changeset 138294 in webkit


Ignore:
Timestamp:
Dec 20, 2012, 1:37:41 PM (12 years ago)
Author:
thakis@chromium.org
Message:

chromium nrwt: Pick the newest binary found in DEFAULT_BUILD_DIRECTORIES, not the first
https://bugs.webkit.org/show_bug.cgi?id=105498

Reviewed by Dirk Pranke.

Use the newest binary available rather than an than always picking one
build directory over another based on iteration order.

  • Scripts/webkitpy/layout_tests/port/chromium.py:

(ChromiumPort._static_build_path):
Check for timestamps.

  • Scripts/webkitpy/layout_tests/port/chromium_mac_unittest.py:

(ChromiumMacPortTest.test_build_path_timestamps):
Test that out / xcodebuild selection happens based on timestamps

  • Scripts/webkitpy/layout_tests/port/chromium_win_unittest.py:

(ChromiumWinPortTest.test_build_path_timestamps):
Test that out / build selection happens based on timestamps

Location:
trunk/Tools
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r138278 r138294  
     12012-12-20  Nico Weber  <thakis@chromium.org>
     2
     3        chromium nrwt: Pick the newest binary found in DEFAULT_BUILD_DIRECTORIES, not the first
     4        https://bugs.webkit.org/show_bug.cgi?id=105498
     5
     6        Reviewed by Dirk Pranke.
     7
     8        Use the newest binary available rather than an than always picking one
     9        build directory over another based on iteration order.
     10
     11        * Scripts/webkitpy/layout_tests/port/chromium.py:
     12        (ChromiumPort._static_build_path):
     13        Check for timestamps.
     14        * Scripts/webkitpy/layout_tests/port/chromium_mac_unittest.py:
     15        (ChromiumMacPortTest.test_build_path_timestamps):
     16        Test that out / xcodebuild selection happens based on timestamps
     17        * Scripts/webkitpy/layout_tests/port/chromium_win_unittest.py:
     18        (ChromiumWinPortTest.test_build_path_timestamps):
     19        Test that out / build selection happens based on timestamps
     20
    1212012-12-19  Simon Fraser  <simon.fraser@apple.com>
    222
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium.py

    r137710 r138294  
    8585            return filesystem.join(build_directory, configuration, *comps)
    8686
     87        hits = []
    8788        for directory in cls.DEFAULT_BUILD_DIRECTORIES:
    8889            base_dir = filesystem.join(chromium_base, directory, configuration)
    89             if filesystem.exists(base_dir):
    90                 return filesystem.join(base_dir, *comps)
     90            path = filesystem.join(base_dir, *comps)
     91            if filesystem.exists(path):
     92                hits.append((filesystem.mtime(path), path))
     93        if hits:
     94            hits.sort(reverse=True)
     95            return hits[0][1]  # Return the newest file found.
    9196
    9297        for directory in cls.DEFAULT_BUILD_DIRECTORIES:
    9398            base_dir = filesystem.join(webkit_base, directory, configuration)
    94             if filesystem.exists(base_dir):
    95                 return filesystem.join(base_dir, *comps)
     99            path = filesystem.join(base_dir, *comps)
     100            if filesystem.exists(path):
     101                hits.append((filesystem.mtime(path), path))
     102
     103        if hits:
     104            hits.sort(reverse=True)
     105            return hits[0][1]  # Return the newest file found.
    96106
    97107        # We have to default to something, so pick the last one.
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_mac_unittest.py

    r136548 r138294  
    9696        self.assert_build_path(options, ['/mock-checkout/Source/WebKit/chromium/xcodebuild/Release', '/mock-checkout/Source/WebKit/chromium/out/Release'], '/mock-checkout/Source/WebKit/chromium/xcodebuild/Release')
    9797
     98    def test_build_path_timestamps(self):
     99        options = MockOptions(configuration='Release', build_directory=None)
     100        port = self.make_port(options=options)
     101        port.host.filesystem.maybe_make_directory('/mock-checkout/out/Release')
     102        port.host.filesystem.maybe_make_directory('/mock-checkout/xcodebuild/Release')
     103        # Check with 'out' being newer.
     104        port.host.filesystem.mtime = lambda f: 5 if '/out/' in f else 4
     105        self.assertEqual(port._build_path(), '/mock-checkout/out/Release')
     106        # Check with 'xcodebuild' being newer.
     107        port.host.filesystem.mtime = lambda f: 5 if '/xcodebuild/' in f else 4
     108        self.assertEqual(port._build_path(), '/mock-checkout/xcodebuild/Release')
     109
    98110    def test_driver_name_option(self):
    99111        self.assertTrue(self.make_port()._path_to_driver().endswith('DumpRenderTree'))
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_win_unittest.py

    r135912 r138294  
    115115        self.assert_build_path(options, ['/mock-checkout/Source/WebKit/chromium/build/Release', '/mock-checkout/Source/WebKit/chromium/out'], '/mock-checkout/Source/WebKit/chromium/build/Release')
    116116
     117    def test_build_path_timestamps(self):
     118        options = MockOptions(configuration='Release', build_directory=None)
     119        port = self.make_port(options=options)
     120        port.host.filesystem.maybe_make_directory('/mock-checkout/out/Release')
     121        port.host.filesystem.maybe_make_directory('/mock-checkout/build/Release')
     122        # Check with 'out' being newer.
     123        port.host.filesystem.mtime = lambda f: 5 if '/out/' in f else 4
     124        self.assertEqual(port._build_path(), '/mock-checkout/out/Release')
     125        # Check with 'build' being newer.
     126        port.host.filesystem.mtime = lambda f: 5 if '/build/' in f else 4
     127        self.assertEqual(port._build_path(), '/mock-checkout/build/Release')
     128
    117129    def test_operating_system(self):
    118130        self.assertEqual('win', self.make_port().operating_system())
Note: See TracChangeset for help on using the changeset viewer.