Title: [123360] trunk/Tools
Revision
123360
Author
[email protected]
Date
2012-07-23 12:26:45 -0700 (Mon, 23 Jul 2012)

Log Message

nrwt: never finds binaries in the 'out' dir on chromium win
https://bugs.webkit.org/show_bug.cgi?id=91890

Reviewed by Tony Chang.

We were figuring out which directory look in for binaries by
testing for the base directory (the directory above
Debug/Release). In chromium-win's case, we look in src/build,
which always exists because there are checked-in files in it,
which means we'd always pick that directory over src/out. All of
the other ports' build_path() implementation was including
Debug/Release. If we matched that, we wouldn't have a problem,
so this change fixes that and updates all of the callers of the
chromium ports' implementation to not pass configuration as part
of the path to look up; we still need to pass configuration in
some cases (to test if the build is out of date between debug
and release) so the implementation gets slightly more
complicated.

* Scripts/webkitpy/layout_tests/port/chromium.py:
(ChromiumPort._static_build_path):
(ChromiumPort.default_results_directory):
(ChromiumPort._build_path):
(ChromiumPort._path_to_image_diff):
* Scripts/webkitpy/layout_tests/port/chromium_android.py:
(ChromiumAndroidPort._build_path):
(ChromiumAndroidPort._path_to_driver):
(ChromiumAndroidPort._path_to_forwarder):
(ChromiumAndroidPort._push_executable):
(ChromiumAndroidPort._push_fonts):
* Scripts/webkitpy/layout_tests/port/chromium_linux.py:
(ChromiumLinuxPort._determine_driver_path_statically):
(ChromiumLinuxPort._modules_to_search_for_symbols):
(ChromiumLinuxPort._path_to_driver):
* Scripts/webkitpy/layout_tests/port/chromium_linux_unittest.py:
(ChromiumLinuxPortTest.test_build_path):
* Scripts/webkitpy/layout_tests/port/chromium_mac.py:
(ChromiumMacPort._modules_to_search_for_symbols):
(ChromiumMacPort._path_to_driver):
(ChromiumMacPort._path_to_helper):
* Scripts/webkitpy/layout_tests/port/chromium_mac_unittest.py:
(ChromiumMacPortTest.test_build_path):
* Scripts/webkitpy/layout_tests/port/chromium_win.py:
(ChromiumWinPort._path_to_driver):
(ChromiumWinPort._path_to_helper):
(ChromiumWinPort._path_to_image_diff):
* Scripts/webkitpy/layout_tests/port/chromium_win_unittest.py:
(ChromiumWinTest.test_build_path):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (123359 => 123360)


--- trunk/Tools/ChangeLog	2012-07-23 19:26:35 UTC (rev 123359)
+++ trunk/Tools/ChangeLog	2012-07-23 19:26:45 UTC (rev 123360)
@@ -1,3 +1,54 @@
+2012-07-23  Dirk Pranke  <[email protected]>
+
+        nrwt: never finds binaries in the 'out' dir on chromium win
+        https://bugs.webkit.org/show_bug.cgi?id=91890
+
+        Reviewed by Tony Chang.
+
+        We were figuring out which directory look in for binaries by
+        testing for the base directory (the directory above
+        Debug/Release). In chromium-win's case, we look in src/build,
+        which always exists because there are checked-in files in it,
+        which means we'd always pick that directory over src/out. All of
+        the other ports' build_path() implementation was including
+        Debug/Release. If we matched that, we wouldn't have a problem,
+        so this change fixes that and updates all of the callers of the
+        chromium ports' implementation to not pass configuration as part
+        of the path to look up; we still need to pass configuration in
+        some cases (to test if the build is out of date between debug
+        and release) so the implementation gets slightly more
+        complicated.
+
+        * Scripts/webkitpy/layout_tests/port/chromium.py:
+        (ChromiumPort._static_build_path):
+        (ChromiumPort.default_results_directory):
+        (ChromiumPort._build_path):
+        (ChromiumPort._path_to_image_diff):
+        * Scripts/webkitpy/layout_tests/port/chromium_android.py:
+        (ChromiumAndroidPort._build_path):
+        (ChromiumAndroidPort._path_to_driver):
+        (ChromiumAndroidPort._path_to_forwarder):
+        (ChromiumAndroidPort._push_executable):
+        (ChromiumAndroidPort._push_fonts):
+        * Scripts/webkitpy/layout_tests/port/chromium_linux.py:
+        (ChromiumLinuxPort._determine_driver_path_statically):
+        (ChromiumLinuxPort._modules_to_search_for_symbols):
+        (ChromiumLinuxPort._path_to_driver):
+        * Scripts/webkitpy/layout_tests/port/chromium_linux_unittest.py:
+        (ChromiumLinuxPortTest.test_build_path):
+        * Scripts/webkitpy/layout_tests/port/chromium_mac.py:
+        (ChromiumMacPort._modules_to_search_for_symbols):
+        (ChromiumMacPort._path_to_driver):
+        (ChromiumMacPort._path_to_helper):
+        * Scripts/webkitpy/layout_tests/port/chromium_mac_unittest.py:
+        (ChromiumMacPortTest.test_build_path):
+        * Scripts/webkitpy/layout_tests/port/chromium_win.py:
+        (ChromiumWinPort._path_to_driver):
+        (ChromiumWinPort._path_to_helper):
+        (ChromiumWinPort._path_to_image_diff):
+        * Scripts/webkitpy/layout_tests/port/chromium_win_unittest.py:
+        (ChromiumWinTest.test_build_path):
+
 2012-07-23  Sheriff Bot  <[email protected]>
 
         Unreviewed, rolling out r123339.

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium.py (123359 => 123360)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium.py	2012-07-23 19:26:35 UTC (rev 123359)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium.py	2012-07-23 19:26:45 UTC (rev 123360)
@@ -78,17 +78,17 @@
     DEFAULT_BUILD_DIRECTORIES = ('out',)
 
     @classmethod
-    def _static_build_path(cls, filesystem, build_directory, chromium_base, webkit_base, *comps):
+    def _static_build_path(cls, filesystem, build_directory, chromium_base, webkit_base, configuration, comps):
         if build_directory:
             return filesystem.join(build_directory, *comps)
 
         for directory in cls.DEFAULT_BUILD_DIRECTORIES:
-            base_dir = filesystem.join(chromium_base, directory)
+            base_dir = filesystem.join(chromium_base, directory, configuration)
             if filesystem.exists(base_dir):
                 return filesystem.join(base_dir, *comps)
 
         for directory in cls.DEFAULT_BUILD_DIRECTORIES:
-            base_dir = filesystem.join(webkit_base, directory)
+            base_dir = filesystem.join(webkit_base, directory, configuration)
             if filesystem.exists(base_dir):
                 return filesystem.join(base_dir, *comps)
 
@@ -263,7 +263,7 @@
         try:
             return self.path_from_chromium_base('webkit', self.get_option('configuration'), 'layout-test-results')
         except AssertionError:
-            return self._build_path(self.get_option('configuration'), 'layout-test-results')
+            return self._build_path('layout-test-results')
 
     def _missing_symbol_to_skipped_tests(self):
         # FIXME: Should WebKitPort have these definitions also?
@@ -386,11 +386,15 @@
     #
 
     def _build_path(self, *comps):
-        return self._static_build_path(self._filesystem, self.get_option('build_directory'), self.path_from_chromium_base(), self.path_from_webkit_base(), *comps)
+        return self._build_path_with_configuration(None, *comps)
 
+    def _build_path_with_configuration(self, configuration, *comps):
+        configuration = configuration or self.get_option('configuration')
+        return self._static_build_path(self._filesystem, self.get_option('build_directory'), self.path_from_chromium_base(), self.path_from_webkit_base(), configuration, comps)
+
     def _path_to_image_diff(self):
         binary_name = 'ImageDiff'
-        return self._build_path(self.get_option('configuration'), binary_name)
+        return self._build_path(binary_name)
 
     def _check_driver_build_up_to_date(self, configuration):
         if configuration in ('Debug', 'Release'):

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py (123359 => 123360)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py	2012-07-23 19:26:35 UTC (rev 123359)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py	2012-07-23 19:26:45 UTC (rev 123360)
@@ -280,8 +280,11 @@
     # Overridden private functions.
 
     def _build_path(self, *comps):
-        return self._host_port._build_path(*comps)
+        self._build_path(None, *comps)
 
+    def _build_path_with_configuration(self, configuration, *comps):
+        return self._host_port._build_path_with_configuration(configuration, *comps)
+
     def _path_to_apache(self):
         return self._host_port._path_to_apache()
 
@@ -289,15 +292,13 @@
         return self._host_port._path_to_apache_config_file()
 
     def _path_to_driver(self, configuration=None):
-        if not configuration:
-            configuration = self.get_option('configuration')
-        return self._build_path(configuration, 'DumpRenderTree_apk/DumpRenderTree-debug.apk')
+        return self._build_path_with_configuration(configuration, 'DumpRenderTree_apk/DumpRenderTree-debug.apk')
 
     def _path_to_helper(self):
         return None
 
     def _path_to_forwarder(self):
-        return self._build_path(self.get_option('configuration'), 'forwarder')
+        return self._build_path('forwarder')
 
     def _path_to_image_diff(self):
         return self._host_port._path_to_image_diff()
@@ -345,14 +346,10 @@
             install_result = self._run_adb_command(['install', drt_host_path])
             if install_result.find('Success') == -1:
                 raise AssertionError('Failed to install %s onto device: %s' % (drt_host_path, install_result))
-            self._push_to_device(self._build_path(self.get_option('configuration'), 'DumpRenderTree.pak'),
-                                 DEVICE_DRT_DIR + 'DumpRenderTree.pak')
-            self._push_to_device(self._build_path(self.get_option('configuration'), 'DumpRenderTree_resources'),
-                                 DEVICE_DRT_DIR + 'DumpRenderTree_resources')
-            self._push_to_device(self._build_path(self.get_option('configuration'), 'android_main_fonts.xml'),
-                                 DEVICE_DRT_DIR + 'android_main_fonts.xml')
-            self._push_to_device(self._build_path(self.get_option('configuration'), 'android_fallback_fonts.xml'),
-                                 DEVICE_DRT_DIR + 'android_fallback_fonts.xml')
+            self._push_to_device(self._build_path('DumpRenderTree.pak'), DEVICE_DRT_DIR + 'DumpRenderTree.pak')
+            self._push_to_device(self._build_path('DumpRenderTree_resources'), DEVICE_DRT_DIR + 'DumpRenderTree_resources')
+            self._push_to_device(self._build_path('android_main_fonts.xml'), DEVICE_DRT_DIR + 'android_main_fonts.xml')
+            self._push_to_device(self._build_path('android_fallback_fonts.xml'), DEVICE_DRT_DIR + 'android_fallback_fonts.xml')
             # Version control of test resources is dependent on executables,
             # because we will always rebuild executables when resources are
             # updated.
@@ -362,7 +359,7 @@
     def _push_fonts(self):
         if not self._check_version(DEVICE_FONTS_DIR, FONT_FILES_VERSION):
             _log.debug('Pushing fonts')
-            path_to_ahem_font = self._build_path(self.get_option('configuration'), 'AHEM____.TTF')
+            path_to_ahem_font = self._build_path('AHEM____.TTF')
             self._push_to_device(path_to_ahem_font, DEVICE_FONTS_DIR + 'AHEM____.TTF')
             for (host_dir, font_file) in HOST_FONT_FILES:
                 self._push_to_device(host_dir + font_file, DEVICE_FONTS_DIR + font_file)

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_linux.py (123359 => 123360)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_linux.py	2012-07-23 19:26:35 UTC (rev 123359)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_linux.py	2012-07-23 19:26:45 UTC (rev 123360)
@@ -69,7 +69,7 @@
             configuration = options.configuration
         else:
             configuration = config_object.default_configuration()
-        return cls._static_build_path(host.filesystem, build_directory, chromium_base, webkit_base, configuration, 'DumpRenderTree')
+        return cls._static_build_path(host.filesystem, build_directory, chromium_base, webkit_base, configuration, ['DumpRenderTree'])
 
     @staticmethod
     def _determine_architecture(filesystem, executive, driver_path):
@@ -111,7 +111,7 @@
         return map(self._webkit_baseline_path, port_names)
 
     def _modules_to_search_for_symbols(self):
-        return [self._build_path(self.get_option('configuration'), 'libffmpegsumo.so')]
+        return [self._build_path('libffmpegsumo.so')]
 
     def check_build(self, needs_http):
         result = chromium.ChromiumPort.check_build(self, needs_http)
@@ -173,10 +173,8 @@
         return "/usr/bin/php-cgi"
 
     def _path_to_driver(self, configuration=None):
-        if not configuration:
-            configuration = self.get_option('configuration')
         binary_name = self.driver_name()
-        return self._build_path(configuration, binary_name)
+        return self._build_path_with_configuration(configuration, binary_name)
 
     def _path_to_helper(self):
         return None

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_linux_unittest.py (123359 => 123360)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_linux_unittest.py	2012-07-23 19:26:35 UTC (rev 123359)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_linux_unittest.py	2012-07-23 19:26:45 UTC (rev 123360)
@@ -93,19 +93,19 @@
     def test_build_path(self):
         # Test that optional paths are used regardless of whether they exist.
         options = MockOptions(configuration='Release', build_directory='/foo')
-        self.assert_build_path(options, ['/mock-checkout/Source/WebKit/chromium/out'], '/foo')
+        self.assert_build_path(options, ['/mock-checkout/Source/WebKit/chromium/out/Release'], '/foo')
 
         # Test that optional relative paths are returned unmodified.
         options = MockOptions(configuration='Release', build_directory='foo')
-        self.assert_build_path(options, ['/mock-checkout/Source/WebKit/chromium/out'], 'foo')
+        self.assert_build_path(options, ['/mock-checkout/Source/WebKit/chromium/out/Release'], 'foo')
 
         # Test that we look in a chromium directory before the webkit directory.
         options = MockOptions(configuration='Release', build_directory=None)
-        self.assert_build_path(options, ['/mock-checkout/Source/WebKit/chromium/out', '/mock-checkout/out'], '/mock-checkout/Source/WebKit/chromium/out')
+        self.assert_build_path(options, ['/mock-checkout/Source/WebKit/chromium/out/Release', '/mock-checkout/out/Release'], '/mock-checkout/Source/WebKit/chromium/out/Release')
 
         # Test that we prefer the legacy dir over the new dir.
         options = MockOptions(configuration='Release', build_directory=None)
-        self.assert_build_path(options, ['/mock-checkout/Source/WebKit/chromium/sconsbuild', '/mock-checkout/Source/WebKit/chromium/out'], '/mock-checkout/Source/WebKit/chromium/sconsbuild')
+        self.assert_build_path(options, ['/mock-checkout/Source/WebKit/chromium/sconsbuild/Release', '/mock-checkout/Source/WebKit/chromium/out/Release'], '/mock-checkout/Source/WebKit/chromium/sconsbuild/Release')
 
     def test_driver_name_option(self):
         self.assertTrue(self.make_port()._path_to_driver().endswith('DumpRenderTree'))

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_mac.py (123359 => 123360)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_mac.py	2012-07-23 19:26:35 UTC (rev 123359)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_mac.py	2012-07-23 19:26:45 UTC (rev 123360)
@@ -79,7 +79,7 @@
         return map(self._webkit_baseline_path, fallback_paths[self._version])
 
     def _modules_to_search_for_symbols(self):
-        return [self._build_path(self.get_option('configuration'), 'ffmpegsumo.so')]
+        return [self._build_path('ffmpegsumo.so')]
 
     def check_build(self, needs_http):
         result = chromium.ChromiumPort.check_build(self, needs_http)
@@ -120,14 +120,11 @@
 
     def _path_to_driver(self, configuration=None):
         # FIXME: make |configuration| happy with case-sensitive file systems.
-        if not configuration:
-            configuration = self.get_option('configuration')
-        return self._build_path(configuration, self.driver_name() + '.app',
-            'Contents', 'MacOS', self.driver_name())
+        return self._build_path_with_configuration(configuration, self.driver_name() + '.app', 'Contents', 'MacOS', self.driver_name())
 
     def _path_to_helper(self):
         binary_name = 'LayoutTestHelper'
-        return self._build_path(self.get_option('configuration'), binary_name)
+        return self._build_path(binary_name)
 
     def _path_to_wdiff(self):
         return 'wdiff'

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_mac_unittest.py (123359 => 123360)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_mac_unittest.py	2012-07-23 19:26:35 UTC (rev 123359)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_mac_unittest.py	2012-07-23 19:26:45 UTC (rev 123360)
@@ -74,19 +74,19 @@
     def test_build_path(self):
         # Test that optional paths are used regardless of whether they exist.
         options = MockOptions(configuration='Release', build_directory='/foo')
-        self.assert_build_path(options, ['/mock-checkout/Source/WebKit/chromium/out'], '/foo')
+        self.assert_build_path(options, ['/mock-checkout/Source/WebKit/chromium/out/Release'], '/foo')
 
         # Test that optional relative paths are returned unmodified.
         options = MockOptions(configuration='Release', build_directory='foo')
-        self.assert_build_path(options, ['/mock-checkout/Source/WebKit/chromium/out'], 'foo')
+        self.assert_build_path(options, ['/mock-checkout/Source/WebKit/chromium/out/Release'], 'foo')
 
         # Test that we look in a chromium directory before the webkit directory.
         options = MockOptions(configuration='Release', build_directory=None)
-        self.assert_build_path(options, ['/mock-checkout/Source/WebKit/chromium/out', '/mock-checkout/out'], '/mock-checkout/Source/WebKit/chromium/out')
+        self.assert_build_path(options, ['/mock-checkout/Source/WebKit/chromium/out/Release', '/mock-checkout/out/Release'], '/mock-checkout/Source/WebKit/chromium/out/Release')
 
         # Test that we prefer the legacy dir over the new dir.
         options = MockOptions(configuration='Release', build_directory=None)
-        self.assert_build_path(options, ['/mock-checkout/Source/WebKit/chromium/xcodebuild', '/mock-checkout/Source/WebKit/chromium/out'], '/mock-checkout/Source/WebKit/chromium/xcodebuild')
+        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')
 
     def test_driver_name_option(self):
         self.assertTrue(self.make_port()._path_to_driver().endswith('DumpRenderTree'))

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_win.py (123359 => 123360)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_win.py	2012-07-23 19:26:35 UTC (rev 123359)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_win.py	2012-07-23 19:26:45 UTC (rev 123360)
@@ -149,18 +149,16 @@
         return self._lighttpd_path('php5', 'php-cgi.exe')
 
     def _path_to_driver(self, configuration=None):
-        if not configuration:
-            configuration = self.get_option('configuration')
         binary_name = '%s.exe' % self.driver_name()
-        return self._build_path(configuration, binary_name)
+        return self._build_path_with_configuration(configuration, binary_name)
 
     def _path_to_helper(self):
         binary_name = 'LayoutTestHelper.exe'
-        return self._build_path(self.get_option('configuration'), binary_name)
+        return self._build_path(binary_name)
 
     def _path_to_image_diff(self):
         binary_name = 'ImageDiff.exe'
-        return self._build_path(self.get_option('configuration'), binary_name)
+        return self._build_path(binary_name)
 
     def _path_to_wdiff(self):
         return self.path_from_chromium_base('third_party', 'cygwin', 'bin', 'wdiff.exe')

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_win_unittest.py (123359 => 123360)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_win_unittest.py	2012-07-23 19:26:35 UTC (rev 123359)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_win_unittest.py	2012-07-23 19:26:45 UTC (rev 123360)
@@ -100,19 +100,19 @@
     def test_build_path(self):
         # Test that optional paths are used regardless of whether they exist.
         options = MockOptions(configuration='Release', build_directory='/foo')
-        self.assert_build_path(options, ['/mock-checkout/Source/WebKit/chromium/out'], '/foo')
+        self.assert_build_path(options, ['/mock-checkout/Source/WebKit/chromium/out/Release'], '/foo')
 
         # Test that optional relative paths are returned unmodified.
         options = MockOptions(configuration='Release', build_directory='foo')
-        self.assert_build_path(options, ['/mock-checkout/Source/WebKit/chromium/out'], 'foo')
+        self.assert_build_path(options, ['/mock-checkout/Source/WebKit/chromium/out/Release'], 'foo')
 
         # Test that we look in a chromium directory before the webkit directory.
         options = MockOptions(configuration='Release', build_directory=None)
-        self.assert_build_path(options, ['/mock-checkout/Source/WebKit/chromium/out', '/mock-checkout/out'], '/mock-checkout/Source/WebKit/chromium/out')
+        self.assert_build_path(options, ['/mock-checkout/Source/WebKit/chromium/out/Release', '/mock-checkout/out/Release'], '/mock-checkout/Source/WebKit/chromium/out/Release')
 
         # Test that we prefer the legacy dir over the new dir.
         options = MockOptions(configuration='Release', build_directory=None)
-        self.assert_build_path(options, ['/mock-checkout/Source/WebKit/chromium/build', '/mock-checkout/Source/WebKit/chromium/out'], '/mock-checkout/Source/WebKit/chromium/build')
+        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')
 
     def test_operating_system(self):
         self.assertEqual('win', self.make_port().operating_system())
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to