summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordpranke@google.com <dpranke@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-08 21:18:02 +0000
committerdpranke@google.com <dpranke@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-08 21:18:02 +0000
commitee82ec3dc0180187107c616b3a8c690215350a44 (patch)
treec0cf1cfb530a3535363a426627f87bbf2cf9a629
parent8e038500d3f1cbd8b67ac31004eeca89284ef3bb (diff)
downloadchromium_src-ee82ec3dc0180187107c616b3a8c690215350a44.zip
chromium_src-ee82ec3dc0180187107c616b3a8c690215350a44.tar.gz
chromium_src-ee82ec3dc0180187107c616b3a8c690215350a44.tar.bz2
Fix line number references in test_expectations.py
R=ojan@chromium.org BUG=29727 TEST=add a syntax error to test_expectations.txt Review URL: http://codereview.chromium.org/465127 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34085 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--webkit/tools/layout_tests/layout_package/test_expectations.py13
-rw-r--r--webkit/tools/layout_tests/update_expectations_from_dashboard.py4
2 files changed, 11 insertions, 6 deletions
diff --git a/webkit/tools/layout_tests/layout_package/test_expectations.py b/webkit/tools/layout_tests/layout_package/test_expectations.py
index bcf11c6..859828e 100644
--- a/webkit/tools/layout_tests/layout_package/test_expectations.py
+++ b/webkit/tools/layout_tests/layout_package/test_expectations.py
@@ -350,8 +350,10 @@ class TestExpectationsFile:
tests_removed = 0
tests_updated = 0
+ lineno = 0
for line in f_orig:
- action = self._GetPlatformUpdateAction(line, tests, platform)
+ lineno += 1
+ action = self._GetPlatformUpdateAction(line, lineno, tests, platform)
if action == NO_CHANGE:
# Save the original line back to the file
logging.debug('No change to test: %s', line)
@@ -403,7 +405,7 @@ class TestExpectationsFile:
os.rename(new_file, self._path)
return True
- def ParseExpectationsLine(self, line):
+ def ParseExpectationsLine(self, line, lineno):
"""Parses a line from test_expectations.txt and returns a tuple with the
test path, options as a list, expectations as a list."""
line = StripComments(line)
@@ -427,7 +429,7 @@ class TestExpectationsFile:
return (test, options, expectations)
- def _GetPlatformUpdateAction(self, line, tests, platform):
+ def _GetPlatformUpdateAction(self, line, lineno, tests, platform):
"""Check the platform option and return the action needs to be taken.
Args:
@@ -441,7 +443,7 @@ class TestExpectationsFile:
REMOVE_PLATFORM: remove this platform option from the test.
ADD_PLATFORMS_EXCEPT_THIS: add all the platforms except this one.
"""
- test, options, expectations = self.ParseExpectationsLine(line)
+ test, options, expectations = self.ParseExpectationsLine(line, lineno)
if not test or test not in tests:
return NO_CHANGE
@@ -537,7 +539,8 @@ class TestExpectationsFile:
for line in expectations:
lineno += 1
- test_list_path, options, expectations = self.ParseExpectationsLine(line)
+ test_list_path, options, expectations = \
+ self.ParseExpectationsLine(line, lineno)
if not expectations:
continue
diff --git a/webkit/tools/layout_tests/update_expectations_from_dashboard.py b/webkit/tools/layout_tests/update_expectations_from_dashboard.py
index 5d0b14e..1866b1e 100644
--- a/webkit/tools/layout_tests/update_expectations_from_dashboard.py
+++ b/webkit/tools/layout_tests/update_expectations_from_dashboard.py
@@ -284,8 +284,10 @@ class ExpectationsUpdater(test_expectations.TestExpectationsFile):
comment_lines = []
removed_test_on_previous_line = False
+ lineno = 0
for line in self._GetIterableExpectations():
- test, options, expectations = self.ParseExpectationsLine(line)
+ lineno += 1
+ test, options, expectations = self.ParseExpectationsLine(line, lineno)
# If there are no updates for this test, then output the line unmodified.
if (test not in update_json):