PATCH: Add KFAIL, KPASS support to DejaGNU emulation

Mark Mitchell mark at codesourcery.com
Thu Nov 17 23:56:20 UTC 2005


This patch adds support for KAIL and KPASS to QMTest's DejaGNU
emulation; these DejaGNU outcomes are essentially identical to XFAIL
and XPASS.

Committed.

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

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

	* qm/test/classes/dejagnu_stream.py
	(DejaGNUStream.__summary_outcomes): Add KFAIL, KPASS.
	(DejaGNUStream.__outcome_descs): Likewise.
	(DejaGNUStream.__expected_outcomes): Likewise.
	(DejaGNUReader.__UpdateResult): Likewise.
	* qm/test/classes/dejagnu_test.py (DejaGNUTest.KFAIL): New
	variable.
	(DejaGNUTest.KPASS): Likewise.
	(DejaGNUTest.outcome_map): Add KFAIL, KPASS.

Index: qm/test/classes/dejagnu_stream.py
===================================================================
RCS file: /home/qm/Repository/qm/qm/test/classes/dejagnu_stream.py,v
retrieving revision 1.8
diff -c -5 -p -r1.8 dejagnu_stream.py
*** qm/test/classes/dejagnu_stream.py	4 Nov 2005 20:37:34 -0000	1.8
--- qm/test/classes/dejagnu_stream.py	17 Nov 2005 23:44:10 -0000
*************** class DejaGNUStream(FileResultStream):
*** 45,54 ****
--- 45,56 ----
          ]
  
      __summary_outcomes = [
          DejaGNUTest.PASS,
          DejaGNUTest.FAIL,
+         DejaGNUTest.KFAIL,
+         DejaGNUTest.KPASS,
          DejaGNUTest.XPASS,
          DejaGNUTest.XFAIL,
          DejaGNUTest.UNRESOLVED,
          DejaGNUTest.UNTESTED,
          DejaGNUTest.UNSUPPORTED
*************** class DejaGNUStream(FileResultStream):
*** 56,65 ****
--- 58,69 ----
      """The outcomes for which summary output should be produced."""
      
      __outcome_descs = {
          DejaGNUTest.PASS: "expected passes",
          DejaGNUTest.FAIL: "unexpected failures",
+         DejaGNUTest.KPASS: "unexpected successes",
+         DejaGNUTest.KFAIL: "expected failures",
          DejaGNUTest.XPASS: "unexpected successes",
          DejaGNUTest.XFAIL: "expected failures",
          DejaGNUTest.UNRESOLVED: "unresolved testcases",
          DejaGNUTest.UNTESTED: "untested testcases",
          DejaGNUTest.UNSUPPORTED: "unsupported tests",
*************** class DejaGNUStream(FileResultStream):
*** 69,78 ****
--- 73,83 ----
      See 'init_testcounts' in the DejaGNU distribution for the code
      emulated by this table."""
  
      __expected_outcomes = (
          DejaGNUTest.PASS,
+         DejaGNUTest.KFAIL,
          DejaGNUTest.XFAIL,
          DejaGNUTest.UNRESOLVED,
          DejaGNUTest.UNSUPPORTED,
          DejaGNUTest.UNTESTED
          )
*************** class DejaGNUReader(FileResultReader):
*** 317,327 ****
          return, it will never have an outcome of 'Result.PASS' upon
          return."""
                         
          # Translate the DejaGNU outcome into a QMTest outcome.
          if self.__GenerateExpectations():
!             if dejagnu_outcome in (DejaGNUTest.XFAIL,
                                     DejaGNUTest.XPASS):
                  qmtest_outcome = Result.FAIL
              elif dejagnu_outcome == DejaGNUTest.UNSUPPORTED:
                  qmtest_outcome = Result.UNTESTED
              else:
--- 322,334 ----
          return, it will never have an outcome of 'Result.PASS' upon
          return."""
                         
          # Translate the DejaGNU outcome into a QMTest outcome.
          if self.__GenerateExpectations():
!             if dejagnu_outcome in (DejaGNUTest.KFAIL,
!                                    DejaGNUTest.KPASS,
!                                    DejaGNUTest.XFAIL,
                                     DejaGNUTest.XPASS):
                  qmtest_outcome = Result.FAIL
              elif dejagnu_outcome == DejaGNUTest.UNSUPPORTED:
                  qmtest_outcome = Result.UNTESTED
              else:
Index: qm/test/classes/dejagnu_test.py
===================================================================
RCS file: /home/qm/Repository/qm/qm/test/classes/dejagnu_test.py,v
retrieving revision 1.6
diff -c -5 -p -r1.6 dejagnu_test.py
*** qm/test/classes/dejagnu_test.py	7 Sep 2005 00:22:17 -0000	1.6
--- qm/test/classes/dejagnu_test.py	17 Nov 2005 23:44:10 -0000
*************** class DejaGNUTest(Test, DejaGNUBase):
*** 42,51 ****
--- 42,53 ----
              description="""The source file."""),
          ]
  
      PASS = "PASS"
      FAIL = "FAIL"
+     KFAIL = "KFAIL"
+     KPASS = "KPASS"
      XPASS = "XPASS"
      XFAIL = "XFAIL"
      WARNING = "WARNING"
      ERROR = "ERROR"
      UNTESTED = "UNTESTED"
*************** class DejaGNUTest(Test, DejaGNUBase):
*** 59,68 ****
--- 61,72 ----
      """The DejaGNU test outcomes."""
      
      outcome_map = {
          PASS : Result.PASS,
          FAIL : Result.FAIL,
+         KFAIL : Result.FAIL,
+         KPASS : Result.PASS,
          XPASS : Result.PASS,
          XFAIL : Result.FAIL,
          WARNING : Result.PASS,
          ERROR : Result.ERROR,
          UNTESTED : Result.UNTESTED,



More information about the qmtest mailing list