| OLD | NEW |
| 1 # Copyright 2008 the V8 project authors. All rights reserved. | 1 # Copyright 2008 the V8 project authors. All rights reserved. |
| 2 # Redistribution and use in source and binary forms, with or without | 2 # Redistribution and use in source and binary forms, with or without |
| 3 # modification, are permitted provided that the following conditions are | 3 # modification, are permitted provided that the following conditions are |
| 4 # met: | 4 # met: |
| 5 # | 5 # |
| 6 # * Redistributions of source code must retain the above copyright | 6 # * Redistributions of source code must retain the above copyright |
| 7 # notice, this list of conditions and the following disclaimer. | 7 # notice, this list of conditions and the following disclaimer. |
| 8 # * Redistributions in binary form must reproduce the above | 8 # * Redistributions in binary form must reproduce the above |
| 9 # copyright notice, this list of conditions and the following | 9 # copyright notice, this list of conditions and the following |
| 10 # disclaimer in the documentation and/or other materials provided | 10 # disclaimer in the documentation and/or other materials provided |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 # Can't use utils.ReadLinesFrom() here because it strips whitespace. | 91 # Can't use utils.ReadLinesFrom() here because it strips whitespace. |
| 92 with open(expected_path) as f: | 92 with open(expected_path) as f: |
| 93 for line in f: | 93 for line in f: |
| 94 if line.startswith("#") or not line.strip(): continue | 94 if line.startswith("#") or not line.strip(): continue |
| 95 expected_lines.append(line) | 95 expected_lines.append(line) |
| 96 raw_lines = output.stdout.splitlines() | 96 raw_lines = output.stdout.splitlines() |
| 97 actual_lines = [ s for s in raw_lines if not self._IgnoreLine(s) ] | 97 actual_lines = [ s for s in raw_lines if not self._IgnoreLine(s) ] |
| 98 env = { "basename": os.path.basename(testpath + ".js") } | 98 env = { "basename": os.path.basename(testpath + ".js") } |
| 99 if len(expected_lines) != len(actual_lines): | 99 if len(expected_lines) != len(actual_lines): |
| 100 return True | 100 return True |
| 101 for (expected, actual) in itertools.izip(expected_lines, actual_lines): | 101 for (expected, actual) in itertools.izip_longest( |
| 102 expected_lines, actual_lines, fillvalue=''): |
| 102 pattern = re.escape(expected.rstrip() % env) | 103 pattern = re.escape(expected.rstrip() % env) |
| 103 pattern = pattern.replace("\\*", ".*") | 104 pattern = pattern.replace("\\*", ".*") |
| 104 pattern = "^%s$" % pattern | 105 pattern = "^%s$" % pattern |
| 105 if not re.match(pattern, actual): | 106 if not re.match(pattern, actual): |
| 106 return True | 107 return True |
| 107 return False | 108 return False |
| 108 | 109 |
| 109 def StripOutputForTransmit(self, testcase): | 110 def StripOutputForTransmit(self, testcase): |
| 110 pass | 111 pass |
| 111 | 112 |
| 112 | 113 |
| 113 def GetSuite(name, root): | 114 def GetSuite(name, root): |
| 114 return MessageTestSuite(name, root) | 115 return MessageTestSuite(name, root) |
| OLD | NEW |