- From: Olivier Thereaux via cvs-syncmail <cvsmail@w3.org>
- Date: Mon, 28 Jul 2008 19:38:28 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/validator/misc/testsuite
In directory hutz:/tmp/cvs-serv5910
Modified Files:
catalog.xml harness.py
Log Message:
finalizing routines and templates for the listing and generation of test cases documentation from the catalog - needs jinja2 template engine
Index: harness.py
===================================================================
RCS file: /sources/public/validator/misc/testsuite/harness.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- harness.py 27 Feb 2008 20:30:34 -0000 1.1
+++ harness.py 28 Jul 2008 19:38:26 -0000 1.2
@@ -20,7 +20,7 @@
sys.path.append(os.path.join(basedir, "lib"))
from ValidatorsAPIs import W3CValidatorHTTP, W3CValidatorHTTP_test
from TestCase import ValidatorTestCase, ValidatorTestSuite, ValidatorTestCase_UT, ValidatorTestSuite_UT
-#from Documentation import Documentation
+from Documentation import Documentation
help_message = '''
Run or Generate test suite for markup validator(s)
@@ -41,7 +41,9 @@
run: run the test suite
sanity: check that this code is still working
useful after using test cases or modifying code
- @@ TBD @@ doc: generate an HTML index of the test cases
+ list: list the available test collections
+ doc: generate an HTML index of the test cases
+ (to be saved in ../htdocs/dev/tests/index.html)
'''
class Usage(Exception):
@@ -112,6 +114,10 @@
suite4 = unittest.TestLoader().loadTestsFromTestCase(W3CValidatorHTTP_test)
suite = unittest.TestSuite([suite1, suite2, suite3, suite4])
unittest.TextTestRunner(verbosity=verbose).run(suite)
+
+ elif args[0] == "list":
+ listCollections()
+
elif args[0] == "doc":
generateIndex()
@@ -143,14 +149,18 @@
if collection.countTestCases() > 0:
unittest.TextTestRunner(verbosity=verbose).run(collection)
-# def generateIndex():
-# index = Documentation('index')
-# for testcollection_file in (glob.glob(os.path.join(basedir, 'testcases', '**', '*.collection'))):
-# colldir = os.path.dirname(os.path.abspath(testcollection_file))
-# colldir = os.path.split(colldir)[-1]
-# testcollection = readCollectionMeta(testcollection_file)
-# index.addCollection(testcollection)
-# print index.generate(template_path=os.path.join(basedir, "templates")).encode('utf-8')
+def listCollections():
+ index = Documentation('list')
+ test_suite = buildTestSuite()
+ index.addTestSuite(test_suite)
+ print index.generate(template_path=os.path.join(basedir, "templates")).encode('utf-8')
+
+
+def generateIndex():
+ index = Documentation('index')
+ test_suite = buildTestSuite()
+ index.addTestSuite(test_suite)
+ print index.generate(template_path=os.path.join(basedir, "templates")).encode('utf-8')
Index: catalog.xml
===================================================================
RCS file: /sources/public/validator/misc/testsuite/catalog.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- catalog.xml 5 May 2008 01:52:14 -0000 1.3
+++ catalog.xml 28 Jul 2008 19:38:26 -0000 1.4
@@ -858,7 +858,9 @@
</test>
</collection>
-<collection id="encodings">
+<collection id="encoding">
+ <dc:title>Document Encoding Tests</dc:title>
+ <collection id="encodings">
<dc:title>Various Encodings</dc:title>
<test>
<uri>http://www.w3.org/Press/1998/XSL-WD.html.ja</uri>
@@ -937,6 +939,7 @@
</expect>
</test>
</collection>
+</collection>
<collection id="errors">
<dc:title>Error conditions & strange cases</dc:title>
Received on Monday, 28 July 2008 19:39:03 UTC