From 53f0cd2f4a2fef445068a0b08d440e67d964c642 Mon Sep 17 00:00:00 2001 From: "agl@chromium.org" Date: Wed, 8 Apr 2009 16:29:30 +0000 Subject: Linux: warning when not running most recent test_shell With the scons GYP switch, you now have to pass --debug to run_layout_tests.sh to run the debug build otherwise you'll silently be running the wrong binary. Warning loudly about this. http://codereview.chromium.org/62137 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13356 0039d316-1c4b-4281-b951-d872f2087c98 --- .../layout_package/platform_utils_linux.py | 27 +++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'webkit/tools') 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 62e236d..18c0743 100644 --- a/webkit/tools/layout_tests/layout_package/platform_utils_linux.py +++ b/webkit/tools/layout_tests/layout_package/platform_utils_linux.py @@ -10,6 +10,7 @@ import re import signal import subprocess import sys +import logging import google.path_utils @@ -173,6 +174,30 @@ class PlatformUtility(object): Args: target: Build target mode (debug or release) """ + + if target in ('Debug', 'Release'): + try: + debug_path = PathFromBase('sconsbuild', 'Debug', self.TestShellBinary()) + release_path = PathFromBase('sconsbuild', 'Release', \ + self.TestShellBinary()) + + debug_mtime = os.stat(debug_path).st_mtime + release_mtime = os.stat(release_path).st_mtime + + if debug_mtime > release_mtime and target == 'Release' or \ + release_mtime > debug_mtime and target == 'Debug': + logging.info('\x1b[31mWarning: you are not running the most ' + \ + 'recent test_shell binary. You need to pass ' + \ + '--debug or not to select between Debug and ' + \ + 'Release.\x1b[0m') + # This will fail if we don't have both a debug and release binary. + # That's fine because, in this case, we must already be running the + # most up-to-date one. + except OSError: + pass + except google.path_utils.PathNotFound: + pass + return PathFromBase('sconsbuild', target, self.TestShellBinary()) def FuzzyMatchBinaryPath(self): @@ -192,4 +217,4 @@ class PlatformUtility(object): def PlatformNewResultsDir(self): """Returns the directory name in which to output newly baselined tests. """ - return self.PlatformDir() \ No newline at end of file + return self.PlatformDir() -- cgit v1.1