| 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 11 matching lines...) Expand all Loading... |
| 22 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 22 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 23 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 24 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 26 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | 27 |
| 28 | 28 |
| 29 import os | 29 import os |
| 30 import shutil | 30 import shutil |
| 31 import subprocess | 31 import subprocess |
| 32 import tarfile | |
| 33 | 32 |
| 34 from testrunner.local import testsuite | 33 from testrunner.local import testsuite |
| 35 from testrunner.objects import testcase | 34 from testrunner.objects import testcase |
| 36 | 35 |
| 37 SVN_SERVER = ( | |
| 38 "svn://svn.chromium.org/chrome/trunk/deps/third_party/mozilla-tests") | |
| 39 MOZILLA_VERSION = "51236" | |
| 40 | |
| 41 | |
| 42 EXCLUDED = ["CVS", ".svn"] | 36 EXCLUDED = ["CVS", ".svn"] |
| 43 | 37 |
| 44 | 38 |
| 45 FRAMEWORK = """ | 39 FRAMEWORK = """ |
| 46 browser.js | 40 browser.js |
| 47 shell.js | 41 shell.js |
| 48 jsref.js | 42 jsref.js |
| 49 template.js | 43 template.js |
| 50 """.split() | 44 """.split() |
| 51 | 45 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 | 106 |
| 113 def IsNegativeTest(self, testcase): | 107 def IsNegativeTest(self, testcase): |
| 114 return testcase.path.endswith("-n") | 108 return testcase.path.endswith("-n") |
| 115 | 109 |
| 116 def IsFailureOutput(self, output, testpath): | 110 def IsFailureOutput(self, output, testpath): |
| 117 if output.exit_code != 0: | 111 if output.exit_code != 0: |
| 118 return True | 112 return True |
| 119 return "FAILED!" in output.stdout | 113 return "FAILED!" in output.stdout |
| 120 | 114 |
| 121 def DownloadData(self): | 115 def DownloadData(self): |
| 122 old_cwd = os.getcwd() | 116 print "Mozilla download is deprecated. It's part of DEPS." |
| 123 os.chdir(os.path.abspath(self.root)) | |
| 124 | 117 |
| 125 # Maybe we're still up to date? | 118 # Clean up old directories and archive files. |
| 126 versionfile = "CHECKED_OUT_VERSION" | 119 directory_old_name = os.path.join(self.root, "data.old") |
| 127 checked_out_version = None | 120 if os.path.exists(directory_old_name): |
| 128 if os.path.exists(versionfile): | 121 shutil.rmtree(directory_old_name) |
| 129 with open(versionfile) as f: | |
| 130 checked_out_version = f.read() | |
| 131 if checked_out_version == MOZILLA_VERSION: | |
| 132 os.chdir(old_cwd) | |
| 133 return | |
| 134 | 122 |
| 135 # If we have a local archive file with the test data, extract it. | 123 archive_files = [f for f in os.listdir(self.root) |
| 136 directory_name = "data" | 124 if f.startswith("downloaded_")] |
| 137 directory_name_old = "data.old" | 125 if len(archive_files) > 0: |
| 138 if os.path.exists(directory_name): | 126 print "Clobber outdated test archives ..." |
| 139 if os.path.exists(directory_name_old): | 127 for f in archive_files: |
| 140 shutil.rmtree(directory_name_old) | 128 os.remove(os.path.join(self.root, f)) |
| 141 os.rename(directory_name, directory_name_old) | |
| 142 archive_file = "downloaded_%s.tar.gz" % MOZILLA_VERSION | |
| 143 if os.path.exists(archive_file): | |
| 144 with tarfile.open(archive_file, "r:gz") as tar: | |
| 145 tar.extractall() | |
| 146 with open(versionfile, "w") as f: | |
| 147 f.write(MOZILLA_VERSION) | |
| 148 os.chdir(old_cwd) | |
| 149 return | |
| 150 | |
| 151 # No cached copy. Check out via SVN, and pack as .tar.gz for later use. | |
| 152 command = ("svn co -r %s %s mozilla/js/tests" % | |
| 153 (MOZILLA_VERSION, SVN_SERVER)) | |
| 154 code = subprocess.call(command, shell=True) | |
| 155 if code != 0: | |
| 156 os.chdir(old_cwd) | |
| 157 raise Exception("Error checking out Mozilla test suite!") | |
| 158 os.rename(os.path.join("mozilla", "js", "tests"), directory_name) | |
| 159 shutil.rmtree("mozilla") | |
| 160 with tarfile.open(archive_file, "w:gz") as tar: | |
| 161 tar.add("data") | |
| 162 with open(versionfile, "w") as f: | |
| 163 f.write(MOZILLA_VERSION) | |
| 164 os.chdir(old_cwd) | |
| 165 | 129 |
| 166 | 130 |
| 167 def GetSuite(name, root): | 131 def GetSuite(name, root): |
| 168 return MozillaTestSuite(name, root) | 132 return MozillaTestSuite(name, root) |
| OLD | NEW |