Merge "[ONOS-6917] Adding more features to the TestON     - Printing out the test cases executed/to be executed     - Printing out the test case that has not passed in the test summary Change-Id: Ic7df056f672c55ecbde72d1fa34b3a216cd735c2"
diff --git a/TestON/core/logger.py b/TestON/core/logger.py
index 79f7c7f..b3b5746 100644
--- a/TestON/core/logger.py
+++ b/TestON/core/logger.py
@@ -284,8 +284,13 @@
         testResult =  testResult + "\n Total Fail           : " + str(main.TOTAL_TC_FAIL)
         testResult =  testResult + "\n Total No Result      : " + str(main.TOTAL_TC_NORESULT)
         testResult =  testResult + "\n Success Percentage   : " + str(main.TOTAL_TC_SUCCESS) + "%"
-        testResult =  testResult + "\n Execution Result     : " + str(main.TOTAL_TC_EXECPERCENT) + "%"
-
+        testResult =  testResult + "\n Execution Result     : " + str(main.TOTAL_TC_EXECPERCENT) + "%\n"
+        if main.failedCase:
+            testResult =  testResult + "\n Case Failed          : " + str( main.failedCase )
+        if main.noResultCase:
+            testResult =  testResult + "\n Case NoResult        : " + str( main.noResultCase )
+        testResult =  testResult + "\n Case Executed        : " + str( main.executedCase )
+        testResult =  testResult + "\n Case Not Executed    : " + str( main.leftCase )
         #main.log.report(testResult)
         main.testResult = testResult
         main.log.exact(testResult)
diff --git a/TestON/core/teston.py b/TestON/core/teston.py
index 0f45e04..89315dc 100644
--- a/TestON/core/teston.py
+++ b/TestON/core/teston.py
@@ -101,6 +101,10 @@
         self.cleanupFlag = False
         self.cleanupLock = threading.Lock()
         self.initiated = False
+        self.executedCase = []
+        self.leftCase = []
+        self.failedCase = []
+        self.noResultCase = []
 
         self.config = self.configparser()
         verifyOptions( options )
@@ -233,7 +237,9 @@
 
         result = self.TRUE
         while repeat:
+            self.leftCase.extend( self.testcases_list )
             for self.CurrentTestCaseNumber in self.testcases_list:
+                self.executedCase.append( self.leftCase.pop( 0 ) )
                 result = self.runCase( self.CurrentTestCaseNumber )
             repeat -= 1
         return result
@@ -258,6 +264,8 @@
         self.stepNumber = 0
         self.EXPERIMENTAL_MODE = self.FALSE
         self.addCaseHeader()
+        self.log.debug( "Case Executed       : " + str( self.executedCase ) )
+        self.log.debug( "Case to be executed : " + str( self.leftCase ) )
         self.testCaseNumber = str( testCaseNumber )
         self.CASERESULT = self.NORESULT
         stopped = False
@@ -292,6 +300,7 @@
             else:
                 self.CASERESULT = self.NORESULT
             self.testCaseResult[str( self.CurrentTestCaseNumber )] = self.CASERESULT
+            self.organizeResult( self.CurrentTestCaseNumber, self.CASERESULT )
             self.logger.updateCaseResults( self )
             self.log.wiki( "<p>" + self.caseExplanation + "</p>" )
             self.log.summary( self.caseExplanation )
@@ -321,6 +330,18 @@
             self.stepCache = ""
         return result
 
+    def organizeResult( self, caseNum, result ):
+        """
+            Organize the result and put the current number into either
+            failed/noResult lists.
+            * caseNum - number of the case
+            * result - result of the case
+        """
+        if result == main.FALSE:
+            self.failedCase.append( caseNum )
+        elif result == self.NORESULT:
+            self.noResultCase.append( caseNum )
+
     def runStep( self, code, testCaseNumber ):
         if not cli.pause:
             try:
@@ -762,6 +783,7 @@
         """
         if self.CurrentTestCaseNumber:
             self.testCaseResult[ str( self.CurrentTestCaseNumber ) ] = self.FALSE
+            self.organizeResult( self.CurrentTestCaseNumber, self.FALSE )
             self.logger.updateCaseResults( self )
         self.cleanup()
         self.exit()