add case number info for core cases
authorsui wendong <weidongx.sun@intel.com>
Tue, 8 Jan 2013 06:38:19 +0000 (14:38 +0800)
committersui wendong <weidongx.sun@intel.com>
Tue, 8 Jan 2013 06:38:19 +0000 (14:38 +0800)
ChangeLog
doc/Testkit-Lite_Quick_Start.pdf
doc/Testkit-Lite_User_Guide.pdf
testkitlite/engines/default/runner.py

index 36f889a..d45262d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
  Tue Jan 4 2013 Zhang Huihui <huihuix.zhang@intel.com> 2.2.9-3
   - add an option to enable memory collection
+  - add case number info for core cases
  Tue Dec 20 2012 Zhang Huihui <huihuix.zhang@intel.com> 2.2.9-2
   - update widget kill regular expression
   - add error message for -o option when the file doesn't exist
index 0c753dd..e9dd7e4 100644 (file)
Binary files a/doc/Testkit-Lite_Quick_Start.pdf and b/doc/Testkit-Lite_Quick_Start.pdf differ
index cdd6f01..9880873 100644 (file)
Binary files a/doc/Testkit-Lite_User_Guide.pdf and b/doc/Testkit-Lite_User_Guide.pdf differ
index 6bb97df..574acaa 100644 (file)
@@ -587,7 +587,7 @@ class TRunner:
                     tset.remove(tc)
 
     def execute(self, testxmlfile, resultfile):
-        def exec_testcase(case):
+        def exec_testcase(case, total_number, current_number):
             case_result = "BLOCK"
             return_code = None
             stderr = "none"
@@ -600,7 +600,7 @@ class TRunner:
             if testentry_elm is not None:
                 test_script_entry = testentry_elm.text
                 expected_result = testentry_elm.get('test_script_expected_result', 'none')
-            print "\n[case] execute case:\nTestCase: %s\nTestEntry: %s\nExpected Result: %s" % (case.get("id"), test_script_entry, expected_result)
+            print "\n[case] execute case:\nTestCase: %s\nTestEntry: %s\nExpected Result: %s\nTotal: %s, Current: %s" % (case.get("id"), test_script_entry, expected_result, total_number, current_number)
             # execute test script
             if testentry_elm is not None:
                 if self.bdryrun:
@@ -706,10 +706,17 @@ class TRunner:
         try:
             ep = etree.parse(testxmlfile)
             rt = ep.getroot()
+            total_number = 0
+            current_number = 0
             for tsuite in rt.getiterator('suite'):
                 for tset in tsuite.getiterator('set'):
                     for tc in tset.getiterator('testcase'):
-                        exec_testcase(tc)
+                        total_number += 1
+            for tsuite in rt.getiterator('suite'):
+                for tset in tsuite.getiterator('set'):
+                    for tc in tset.getiterator('testcase'):
+                        current_number += 1
+                        exec_testcase(tc, total_number, current_number)
             ep.write(resultfile)
             return True
         except Exception, e: