# HG changeset patch # User Atul Varma # Date 1252618577 25200 # Node ID f30bd92e22165fc2d2336f3eaa7ba5ffe86aa7c0 # Parent 16fe9c63aedb647fcb8734e3c8ea076432fbaa9e Added support for running test suite over http. diff -r 16fe9c63aedb -r f30bd92e2216 test_pydertron.py --- a/test_pydertron.py Thu Sep 10 14:27:28 2009 -0700 +++ b/test_pydertron.py Thu Sep 10 14:36:17 2009 -0700 @@ -30,26 +30,43 @@ if __name__ == '__main__': base_libpath = os.path.join("interoperablejs-read-only", "compliance") - if not os.path.exists(base_libpath): + + if len(sys.argv) == 2 and sys.argv[1] == '--with-http': + with_http = True + else: + with_http = False + + if not os.path.exists(base_libpath) and not with_http: print "Please run the following command and then re-run " print "this script:" print print ("svn checkout " "http://interoperablejs.googlecode.com/svn/trunk/ " "interoperablejs-read-only") + print + print "Alternatively, run this script with the '--with-http' " + print "option to run the tests over http." sys.exit(1) - dirs = [(os.path.join(base_libpath, name), name) - for name in os.listdir(base_libpath) - if name not in ['.svn', 'ORACLE']] + BASE_URL = "http://interoperablejs.googlecode.com/svn/trunk/compliance/" + + if with_http: + names = ['absolute', 'cyclic', 'determinism', 'exactExports', + 'hasOwnProperty', 'method', 'missing', 'monkeys', + 'nested', 'reflexive', 'relative', 'transitive'] + dirs = [("%s%s/"% (BASE_URL, name), name) + for name in names] + fsfactory = HttpFileSystem + else: + dirs = [(os.path.join(base_libpath, name), name) + for name in os.listdir(base_libpath) + if name not in ['.svn', 'ORACLE']] + fsfactory = SandboxedFileSystem totals = {'pass': 0, 'fail': 0} - BASE_URL = "http://interoperablejs.googlecode.com/svn/trunk/compliance/" - for libpath, name in dirs: - #fs = HttpFileSystem("%s%s/"% (BASE_URL, name)) - fs = SandboxedFileSystem(libpath) + fs = fsfactory(libpath) stats = run_test(name, fs) totals['pass'] += stats['pass'] totals['fail'] += stats['fail']