summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorjeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-06 23:21:28 +0000
committerjeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-06 23:21:28 +0000
commitae0f44dd31b81be0d9e0ef5d4478e0ef5ca2805d (patch)
tree7012e5c58c43d1e46ea1f2d6df827e77bfde6340 /webkit
parente0111a1986e2bc833ec44e789a9b319eb7986c58 (diff)
downloadchromium_src-ae0f44dd31b81be0d9e0ef5d4478e0ef5ca2805d.zip
chromium_src-ae0f44dd31b81be0d9e0ef5d4478e0ef5ca2805d.tar.gz
chromium_src-ae0f44dd31b81be0d9e0ef5d4478e0ef5ca2805d.tar.bz2
Make run_webkit_tests understand OS version-specific results.
Modify run_webkit_tests to read test results from OS-specific results directories e.g. chromium-mac-leopard. We still want to output new baselines to chromium-mac, so a bit of plumbing was needed to not use the platform name directly to construct the output directory name but instead delegate to path_utils*. Review URL: http://codereview.chromium.org/59006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13205 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/tools/layout_tests/layout_package/path_utils.py17
-rw-r--r--webkit/tools/layout_tests/layout_package/platform_utils_linux.py5
-rw-r--r--webkit/tools/layout_tests/layout_package/platform_utils_mac.py28
-rw-r--r--webkit/tools/layout_tests/layout_package/platform_utils_win.py5
-rwxr-xr-xwebkit/tools/layout_tests/run_webkit_tests.py20
-rw-r--r--webkit/tools/layout_tests/test_types/test_type_base.py11
-rw-r--r--webkit/tools/layout_tests/test_types/text_diff.py7
7 files changed, 72 insertions, 21 deletions
diff --git a/webkit/tools/layout_tests/layout_package/path_utils.py b/webkit/tools/layout_tests/layout_package/path_utils.py
index bd6d0dc..65160e4 100644
--- a/webkit/tools/layout_tests/layout_package/path_utils.py
+++ b/webkit/tools/layout_tests/layout_package/path_utils.py
@@ -51,23 +51,23 @@ def LayoutDataDir():
'data', 'layout_tests')
return _layout_data_dir
-def ChromiumPlatformResultsDir():
+def ChromiumPlatformResultsEnclosingDir():
"""Returns the full path to the directory containing Chromium platform
result directories.
"""
# TODO(pamg): Once we move platform/chromium-* into LayoutTests/platform/,
- # remove this and use PlatformResultsDir() for everything.
+ # remove this and use PlatformResultsEnclosingDir() for everything.
return os.path.join(LayoutDataDir(), 'platform')
-def WebKitPlatformResultsDir():
+def WebKitPlatformResultsEnclosingDir():
"""Gets the full path to just above the platform results directory."""
return os.path.join(LayoutDataDir(), 'LayoutTests', 'platform')
-def PlatformResultsDir(platform):
+def PlatformResultsEnclosingDir(platform):
"""Gets the path to just above the results directory for this platform."""
if platform.startswith('chromium'):
- return ChromiumPlatformResultsDir()
- return WebKitPlatformResultsDir()
+ return ChromiumPlatformResultsEnclosingDir()
+ return WebKitPlatformResultsEnclosingDir()
def ExpectedFilename(filename, suffix, platform):
"""Given a test name, returns an absolute path to its expected results.
@@ -155,7 +155,7 @@ def ExpectedFilename(filename, suffix, platform):
if 'mac' not in platform_dirs:
platform_dirs.append('mac')
- platform_dirs = [os.path.join(PlatformResultsDir(x), x)
+ platform_dirs = [os.path.join(PlatformResultsEnclosingDir(x), x)
for x in platform_dirs]
_platform_results_dirs[platform] = platform_dirs
@@ -216,3 +216,6 @@ def TestListPlatformDir():
def PlatformDir():
return GetPlatformUtil().PlatformDir()
+
+def PlatformNewResultsDir():
+ return GetPlatformUtil().PlatformNewResultsDir() \ No newline at end of file
diff --git a/webkit/tools/layout_tests/layout_package/platform_utils_linux.py b/webkit/tools/layout_tests/layout_package/platform_utils_linux.py
index 72aa927..b6fc0c2 100644
--- a/webkit/tools/layout_tests/layout_package/platform_utils_linux.py
+++ b/webkit/tools/layout_tests/layout_package/platform_utils_linux.py
@@ -188,3 +188,8 @@ class PlatformUtility(object):
results live.
"""
return 'chromium-linux'
+
+ def PlatformNewResultsDir(self):
+ """Returns the directory name in which to output newly baselined tests.
+ """
+ return self.PlatformDir() \ No newline at end of file
diff --git a/webkit/tools/layout_tests/layout_package/platform_utils_mac.py b/webkit/tools/layout_tests/layout_package/platform_utils_mac.py
index 82dfcb1..0ff6c9c 100644
--- a/webkit/tools/layout_tests/layout_package/platform_utils_mac.py
+++ b/webkit/tools/layout_tests/layout_package/platform_utils_mac.py
@@ -6,6 +6,7 @@
"""Platform-specific utility methods shared by several scripts."""
import os
+import platform
import re
import signal
import subprocess
@@ -33,6 +34,22 @@ def GetTestListPlatformName():
test list files."""
return "MAC"
+def _HumanReadableSystemVersionName():
+ """ Returns the name of this OS X system version, or an empty string if this
+ is an unknown OS version.
+
+ Note: Chrome doesn't support Tiger, so the minimum version returned is
+ Leopard (10.5).
+ """
+ os_version_string = platform.mac_ver()[0] # e.g. "10.5.6"
+ release_version = int(os_version_string.split('.')[1])
+ if release_version == 5:
+ return 'leopard'
+ elif release_version == 6:
+ return 'snowleopard'
+ else:
+ return ''
+
class PlatformUtility(object):
def __init__(self, base_dir):
"""Args:
@@ -163,4 +180,13 @@ class PlatformUtility(object):
"""Returns the most specific directory name where platform-specific
results live.
"""
- return 'chromium-mac'
+ platform_dir = 'chromium-mac'
+ os_name = _HumanReadableSystemVersionName()
+ if len(os_name) > 0:
+ platform_dir += "-" + os_name
+ return platform_dir
+
+ def PlatformNewResultsDir(self):
+ """Returns the directory name in which to output newly baselined tests.
+ """
+ return 'chromium-mac'
diff --git a/webkit/tools/layout_tests/layout_package/platform_utils_win.py b/webkit/tools/layout_tests/layout_package/platform_utils_win.py
index 5695a28..cd54f32 100644
--- a/webkit/tools/layout_tests/layout_package/platform_utils_win.py
+++ b/webkit/tools/layout_tests/layout_package/platform_utils_win.py
@@ -209,3 +209,8 @@ class PlatformUtility(google.platform_utils_win.PlatformUtility):
results live.
"""
return 'chromium-win'
+
+ def PlatformNewResultsDir(self):
+ """Returns the directory name in which to output newly baselined tests.
+ """
+ return self.PlatformDir()
diff --git a/webkit/tools/layout_tests/run_webkit_tests.py b/webkit/tools/layout_tests/run_webkit_tests.py
index 6d2387e..c96387a 100755
--- a/webkit/tools/layout_tests/run_webkit_tests.py
+++ b/webkit/tools/layout_tests/run_webkit_tests.py
@@ -63,14 +63,17 @@ class TestRunner:
HTTP_SUBDIR = os.sep.join(['', 'http', ''])
- def __init__(self, options, paths):
+ def __init__(self, options, paths, platform_new_results_dir):
"""Collect a list of files to test.
Args:
options: a dictionary of command line options
paths: a list of paths to crawl looking for test files
+ platform_new_results_dir: name of leaf directory to put rebaselined files
+ in.
"""
self._options = options
+ self._platform_new_results_dir = platform_new_results_dir
self._http_server = http_server.Lighttpd(options.results_directory)
# a list of TestType objects
@@ -413,7 +416,8 @@ class TestRunner:
test_types = []
for t in self._test_types:
test_types.append(t(self._options.platform,
- self._options.results_directory))
+ self._options.results_directory,
+ self._platform_new_results_dir))
test_args, shell_args = self._GetTestShellArgs(i)
thread = test_shell_thread.TestShellThread(filename_queue,
@@ -770,6 +774,12 @@ def main(options, args):
if options.platform is None:
options.platform = path_utils.PlatformDir()
+ platform_new_results_dir = path_utils.PlatformNewResultsDir()
+ else:
+ # If the user specified a platform on the command line then use
+ # that as the name of the output directory for rebaselined files.
+ platform_new_results_dir = options.platform
+
if not options.num_test_shells:
# Only run stable configurations with multiple test_shells by default.
@@ -804,7 +814,7 @@ def main(options, args):
if not paths:
paths = ['.']
- test_runner = TestRunner(options, paths)
+ test_runner = TestRunner(options, paths, platform_new_results_dir)
if options.lint_test_files:
# Just creating the TestRunner checks the syntax of the test lists.
@@ -823,8 +833,8 @@ def main(options, args):
logging.info("Placing test results in %s" % options.results_directory)
if options.new_baseline:
logging.info("Placing new baselines in %s" %
- os.path.join(path_utils.PlatformResultsDir(options.platform),
- options.platform))
+ os.path.join(path_utils.PlatformResultsEnclosingDir(options.platform),
+ platform_new_results_dir))
logging.info("Using %s build at %s" %
(options.target, test_shell_binary_path))
if not options.no_pixel_tests:
diff --git a/webkit/tools/layout_tests/test_types/test_type_base.py b/webkit/tools/layout_tests/test_types/test_type_base.py
index 691599c..b51677e 100644
--- a/webkit/tools/layout_tests/test_types/test_type_base.py
+++ b/webkit/tools/layout_tests/test_types/test_type_base.py
@@ -48,16 +48,19 @@ class TestTypeBase(object):
FILENAME_SUFFIX_WDIFF = "-wdiff.html"
FILENAME_SUFFIX_COMPARE = "-diff.png"
- def __init__(self, platform, root_output_dir):
+ def __init__(self, platform, root_output_dir, platform_new_results_dir):
"""Initialize a TestTypeBase object.
Args:
platform: the platform (e.g., 'chromium-mac-leopard') identifying the
- platform-specific results to be used
+ platform-specific results to be used.
root_output_dir: The unix style path to the output dir.
+ platform_new_results_dir: Name of the directory to put newly baselined
+ results in.
"""
self._root_output_dir = root_output_dir
self._platform = platform
+ self._platform_new_results_dir = platform_new_results_dir
def _MakeOutputDirectory(self, filename):
"""Creates the output directory (if needed) for a given test filename."""
@@ -77,8 +80,8 @@ class TestTypeBase(object):
modifier: type of the result file, e.g. ".txt" or ".png"
"""
relative_dir = os.path.dirname(path_utils.RelativeTestFilename(filename))
- output_dir = os.path.join(path_utils.PlatformResultsDir(self._platform),
- self._platform,
+ output_dir = os.path.join(path_utils.PlatformResultsEnclosingDir(self._platform),
+ self._platform_new_results_dir,
relative_dir)
output_file = os.path.basename(os.path.splitext(filename)[0] +
self.FILENAME_SUFFIX_EXPECTED + modifier)
diff --git a/webkit/tools/layout_tests/test_types/text_diff.py b/webkit/tools/layout_tests/test_types/text_diff.py
index 3561e6a..c1d1b70 100644
--- a/webkit/tools/layout_tests/test_types/text_diff.py
+++ b/webkit/tools/layout_tests/test_types/text_diff.py
@@ -67,10 +67,9 @@ class TestTextDiff(test_type_base.TestTypeBase):
self.FILENAME_SUFFIX_EXPECTED + modifier)
if isRenderTreeDump(data):
relative_dir = os.path.dirname(path_utils.RelativeTestFilename(filename))
- output_dir = os.path.join(path_utils.PlatformResultsDir(self._platform),
- self._platform,
+ output_dir = os.path.join(path_utils.PlatformResultsEnclosingDir(self._platform),
+ self._platform_new_results_dir,
relative_dir)
-
google.path_utils.MaybeMakeDirectory(output_dir)
open(os.path.join(output_dir, output_file), "wb").write(data)
else:
@@ -78,7 +77,7 @@ class TestTextDiff(test_type_base.TestTypeBase):
# platforms. Copy the file into the chromium-win and chromium-mac dirs.
relative_dir = os.path.dirname(path_utils.RelativeTestFilename(filename))
for platform in ('chromium-win', 'chromium-mac'):
- output_dir = os.path.join(path_utils.PlatformResultsDir(self._platform),
+ output_dir = os.path.join(path_utils.PlatformResultsEnclosingDir(self._platform),
platform,
relative_dir)