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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 return testcase.flags + result | 100 return testcase.flags + result |
101 | 101 |
102 def GetSourceForTest(self, testcase): | 102 def GetSourceForTest(self, testcase): |
103 filename = os.path.join(self.testroot, testcase.path + ".js") | 103 filename = os.path.join(self.testroot, testcase.path + ".js") |
104 with open(filename) as f: | 104 with open(filename) as f: |
105 return f.read() | 105 return f.read() |
106 | 106 |
107 def IsNegativeTest(self, testcase): | 107 def IsNegativeTest(self, testcase): |
108 return testcase.path.endswith("-n") | 108 return testcase.path.endswith("-n") |
109 | 109 |
110 def IsFailureOutput(self, output, testpath): | 110 def IsFailureOutput(self, testcase): |
111 if output.exit_code != 0: | 111 if testcase.output.exit_code != 0: |
112 return True | 112 return True |
113 return "FAILED!" in output.stdout | 113 return "FAILED!" in output.stdout |
114 | 114 |
115 def DownloadData(self): | 115 def DownloadData(self): |
116 print "Mozilla download is deprecated. It's part of DEPS." | 116 print "Mozilla download is deprecated. It's part of DEPS." |
117 | 117 |
118 # Clean up old directories and archive files. | 118 # Clean up old directories and archive files. |
119 directory_old_name = os.path.join(self.root, "data.old") | 119 directory_old_name = os.path.join(self.root, "data.old") |
120 if os.path.exists(directory_old_name): | 120 if os.path.exists(directory_old_name): |
121 shutil.rmtree(directory_old_name) | 121 shutil.rmtree(directory_old_name) |
122 | 122 |
123 archive_files = [f for f in os.listdir(self.root) | 123 archive_files = [f for f in os.listdir(self.root) |
124 if f.startswith("downloaded_")] | 124 if f.startswith("downloaded_")] |
125 if len(archive_files) > 0: | 125 if len(archive_files) > 0: |
126 print "Clobber outdated test archives ..." | 126 print "Clobber outdated test archives ..." |
127 for f in archive_files: | 127 for f in archive_files: |
128 os.remove(os.path.join(self.root, f)) | 128 os.remove(os.path.join(self.root, f)) |
129 | 129 |
130 | 130 |
131 def GetSuite(name, root): | 131 def GetSuite(name, root): |
132 return MozillaTestSuite(name, root) | 132 return MozillaTestSuite(name, root) |
OLD | NEW |