PATCH: Fix typos in CheckExitStatus

Mark Mitchell mark at codesourcery.com
Thu Dec 1 06:52:06 UTC 2005


When CheckExitStatus got moved into the Result class, some of the
places where it used "result" were not updated; these are now "self".

Applied.

--
Mark Mitchell
CodeSourcery, LLC
mark at codesourcery.com

2005-11-30  Mark Mitchell  <mark at codesourcery.com>

	* qm/test/result.py (Result.CheckExitStatus): Fix typos.

Index: qm/test/result.py
===================================================================
RCS file: /home/qm/Repository/qm/qm/test/result.py,v
retrieving revision 1.29
diff -c -5 -p -r1.29 result.py
*** qm/test/result.py	26 Oct 2005 02:55:21 -0000	1.29
--- qm/test/result.py	1 Dec 2005 06:49:54 -0000
*************** class Result:
*** 329,340 ****
  
          
      def CheckExitStatus(self, prefix, desc, status, non_zero_exit_ok = 0):
          """Check the exit status from a command.
  
-         'result' -- The 'Result' object to update.
- 
          'prefix' -- The prefix that should be used when creating
          result annotations.
  
          'desc' -- A description of the executing program.
          
--- 329,338 ----
*************** class Result:
*** 351,371 ****
                  exit_code = status
              else:
                  exit_code = os.WEXITSTATUS(status)
              # If the exit code is non-zero, the test fails.
              if exit_code != 0 and not non_zero_exit_ok:
!                 result.Fail("%s failed with exit code %d." % (desc, exit_code))
                  # Record the exit code in the result.
!                 result[prefix + "exit_code"] = str(exit_code)
                  return False
          
          elif os.WIFSIGNALED(status):
              # Obtain the signal number.
              signal = os.WTERMSIG(status)
              # If the program gets a fatal signal, the test fails .
!             result.Fail("%s received fatal signal %d." % (desc, signal))
!             result[prefix + "signal"] = str(signal)
              return False
          else:
              # A process should only be able to stop by exiting, or
              # by being terminated with a signal.
              assert None
--- 349,369 ----
                  exit_code = status
              else:
                  exit_code = os.WEXITSTATUS(status)
              # If the exit code is non-zero, the test fails.
              if exit_code != 0 and not non_zero_exit_ok:
!                 self.Fail("%s failed with exit code %d." % (desc, exit_code))
                  # Record the exit code in the result.
!                 self[prefix + "exit_code"] = str(exit_code)
                  return False
          
          elif os.WIFSIGNALED(status):
              # Obtain the signal number.
              signal = os.WTERMSIG(status)
              # If the program gets a fatal signal, the test fails .
!             self.Fail("%s received fatal signal %d." % (desc, signal))
!             self[prefix + "signal"] = str(signal)
              return False
          else:
              # A process should only be able to stop by exiting, or
              # by being terminated with a signal.
              assert None



More information about the qmtest mailing list