[CalendarServer-changes] [9923] CalDAVTester/trunk

source_changes at macosforge.org source_changes at macosforge.org
Thu Oct 11 08:27:57 PDT 2012


Revision: 9923
          http://trac.calendarserver.org//changeset/9923
Author:   cdaboo at apple.com
Date:     2012-10-11 08:27:57 -0700 (Thu, 11 Oct 2012)
Log Message:
-----------
Add a useful option to limit the tests to just a few select test suites via the addition of an "only='yes'" attribute to the test-suite element.

Modified Paths:
--------------
    CalDAVTester/trunk/scripts/tests/CalDAV/caldavtest.dtd
    CalDAVTester/trunk/scripts/tests/CardDAV/caldavtest.dtd
    CalDAVTester/trunk/src/caldavtest.py
    CalDAVTester/trunk/src/testsuite.py
    CalDAVTester/trunk/src/xmlDefs.py

Modified: CalDAVTester/trunk/scripts/tests/CalDAV/caldavtest.dtd
===================================================================
--- CalDAVTester/trunk/scripts/tests/CalDAV/caldavtest.dtd	2012-10-11 02:33:59 UTC (rev 9922)
+++ CalDAVTester/trunk/scripts/tests/CalDAV/caldavtest.dtd	2012-10-11 15:27:57 UTC (rev 9923)
@@ -64,7 +64,8 @@
 
 	<!ELEMENT test-suite (require-feature?, exclude-feature?, test*)>
 		<!ATTLIST test-suite name CDATA #REQUIRED
-							ignore (yes|no) "no">
+							ignore (yes|no) "no"
+							only (yes|no) "no">
 	
 		<!ELEMENT test (require-feature?, exclude-feature?, description?, (request|pause)+)>
 			<!ATTLIST test name CDATA #REQUIRED

Modified: CalDAVTester/trunk/scripts/tests/CardDAV/caldavtest.dtd
===================================================================
--- CalDAVTester/trunk/scripts/tests/CardDAV/caldavtest.dtd	2012-10-11 02:33:59 UTC (rev 9922)
+++ CalDAVTester/trunk/scripts/tests/CardDAV/caldavtest.dtd	2012-10-11 15:27:57 UTC (rev 9923)
@@ -29,7 +29,7 @@
 
 	<!ELEMENT pause EMPTY>
 
-	<!ELEMENT request (require-feature?, exclude-feature?, method, ruri*, header*, data?, verify*, grabheader*, grabproperty*, grabelement*)>
+	<!ELEMENT request (require-feature?, exclude-feature?, method, ruri*, header*, data?, verify*, graburi?, grabheader*, grabproperty*, grabelement*)>
 		<!ATTLIST request auth (yes|no) "yes"
 						 user CDATA ""
 						 pswd CDATA ""
@@ -52,6 +52,8 @@
 				<!ELEMENT callback (#PCDATA)>
 				<!ELEMENT arg (name, value*)>
 		
+		<!ELEMENT graburi (#PCDATA)>
+
 		<!ELEMENT grabheader (name, variable)>
 	
 		<!ELEMENT grabproperty (property, variable)>
@@ -62,7 +64,8 @@
 
 	<!ELEMENT test-suite (require-feature?, exclude-feature?, test*)>
 		<!ATTLIST test-suite name CDATA #REQUIRED
-							ignore (yes|no) "no">
+							ignore (yes|no) "no"
+							only (yes|no) "no">
 	
 		<!ELEMENT test (require-feature?, exclude-feature?, description?, (request|pause)+)>
 			<!ATTLIST test name CDATA #REQUIRED

Modified: CalDAVTester/trunk/src/caldavtest.py
===================================================================
--- CalDAVTester/trunk/src/caldavtest.py	2012-10-11 02:33:59 UTC (rev 9922)
+++ CalDAVTester/trunk/src/caldavtest.py	2012-10-11 15:27:57 UTC (rev 9923)
@@ -1,5 +1,5 @@
 ##
-# Copyright (c) 2006-2011 Apple Inc. All rights reserved.
+# Copyright (c) 2006-2012 Apple Inc. All rights reserved.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -73,6 +73,7 @@
         self.require_features = set()
         self.exclude_features = set()
         self.ignore_all = False
+        self.only = False
         self.start_requests = []
         self.end_requests = []
         self.end_deletes = []
@@ -98,6 +99,7 @@
             self.manager.log(manager.LOG_HIGH, "      Excluded features: %s" % (", ".join(sorted(self.excludedFeatures())),))
             return 0, 0, 1
 
+        self.only = any([suite.only for suite in self.suites])
         try:
             self.manager.log(manager.LOG_HIGH, "----- Running Tests from \"%s\"... -----" % self.name, before=1)
             result = self.dorequests("Executing Start Requests...", self.start_requests, False, True, label="%s | %s" % (self.name, "START_REQUESTS"))
@@ -139,7 +141,7 @@
         failed = 0
         ignored = 0
         postgresCount = None
-        if suite.ignore:
+        if self.only and not suite.only or suite.ignore:
             self.manager.log(manager.LOG_HIGH, "[IGNORED]")
             ignored = len(suite.tests)
         elif len(suite.missingFeatures()) != 0:

Modified: CalDAVTester/trunk/src/testsuite.py
===================================================================
--- CalDAVTester/trunk/src/testsuite.py	2012-10-11 02:33:59 UTC (rev 9922)
+++ CalDAVTester/trunk/src/testsuite.py	2012-10-11 15:27:57 UTC (rev 9923)
@@ -1,5 +1,5 @@
 ##
-# Copyright (c) 2006-2010 Apple Inc. All rights reserved.
+# Copyright (c) 2006-2012 Apple Inc. All rights reserved.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -31,6 +31,7 @@
         self.manager = manager
         self.name = ""
         self.ignore = False
+        self.only = False
         self.require_features = set()
         self.exclude_features = set()
         self.tests = []
@@ -47,6 +48,7 @@
     def parseXML(self, node):
         self.name = node.get(src.xmlDefs.ATTR_NAME, "")
         self.ignore = getYesNoAttributeValue(node, src.xmlDefs.ATTR_IGNORE)
+        self.only = getYesNoAttributeValue(node, src.xmlDefs.ATTR_ONLY)
 
         for child in node.getchildren():
             if child.tag == src.xmlDefs.ELEMENT_REQUIRE_FEATURE:

Modified: CalDAVTester/trunk/src/xmlDefs.py
===================================================================
--- CalDAVTester/trunk/src/xmlDefs.py	2012-10-11 02:33:59 UTC (rev 9922)
+++ CalDAVTester/trunk/src/xmlDefs.py	2012-10-11 15:27:57 UTC (rev 9923)
@@ -80,6 +80,7 @@
 ATTR_IGNORE_ALL = "ignore-all"
 ATTR_INTERVAL = "interval"
 ATTR_NAME = "name"
+ATTR_ONLY = "only"
 ATTR_PRINT_REQUEST = "print-request"
 ATTR_PRINT_RESPONSE = "print-response"
 ATTR_PSWD = "pswd"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20121011/59d01016/attachment.html>


More information about the calendarserver-changes mailing list