Update web-platform-tests.

This commit is contained in:
Ms2ger 2015-04-09 13:39:50 +02:00
parent 74afd086d2
commit 71008d816d
62 changed files with 793 additions and 150 deletions

View file

@ -0,0 +1,6 @@
*#
*.py[co]
*.sw[po]
*~
\#*

View file

@ -2,6 +2,7 @@
import argparse
import imp
import os
import sys
import manifest
import vcs
@ -82,11 +83,32 @@ def create_parser():
return parser
def main():
def find_top_repo():
path = here
rv = None
while path != "/":
if vcs.is_git_repo(path):
rv = path
path = os.path.abspath(os.path.join(path, os.pardir))
return rv
def main(default_tests_root=None):
opts = create_parser().parse_args()
if opts.tests_root is None:
opts.tests_root = vcs.get_repo_root()
tests_root = None
if default_tests_root is not None:
tests_root = default_tests_root
else:
tests_root = find_top_repo()
if tests_root is None:
print >> sys.stderr, """No git repo found; could not determine test root.
Run again with --test-root"""
sys.exit(1)
opts.tests_root = tests_root
if opts.path is None:
opts.path = os.path.join(opts.tests_root, "MANIFEST.json")

View file

@ -13,9 +13,13 @@ def is_git_repo(tests_root):
_repo_root = None
def get_repo_root():
def get_repo_root(initial_dir=None):
global _repo_root
if initial_dir is None:
initial_dir = os.path.dirname(__file__)
if _repo_root is None:
git = get_git_func(os.path.dirname(__file__))
git = get_git_func(initial_dir)
_repo_root = git("rev-parse", "--show-toplevel").rstrip()
return _repo_root