Changeset: 61bdb9180d7f for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=61bdb9180d7f
Modified Files:
        testing/Mtest.py.in
Branch: Jul2012
Log Message:

Implemented negative conditionals.
Useful if you need to run a test if a conditional does not hold.


diffs (55 lines):

diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -1715,6 +1715,11 @@ def RunTest(env, TST, BusyPorts, COND, o
         EXT = CALL = SERVER = ""
         if COND:
             for cond in COND.split('&'):
+                if cond[:1] == '!':
+                    negate = True
+                    cond = cond[1:]
+                else:
+                    negate = False
                 if cond == 'PREVREL':
                     if not os.path.exists(os.path.join(env['GDK_DBFARM'], 
'prevrel.zip')):
                         reason = "as previous release database is not 
available"
@@ -1729,8 +1734,11 @@ def RunTest(env, TST, BusyPorts, COND, o
                     reason = "as conditional '%s' is unknown." % cond
                     elem = SkipTest(env, TST, EXT, reason, length)
                     break
-                elif not CONDITIONALS[cond]:
-                    reason = "as conditional '%s' does not hold." % cond
+                elif (not CONDITIONALS[cond]) != negate:
+                    if negate:
+                        reason = "as conditional '%s' holds." % cond
+                    else:
+                        reason = "as conditional '%s' does not hold." % cond
                     elem = SkipTest(env, TST, EXT, reason, length)
                     break
         if reason:
@@ -1753,6 +1761,11 @@ def RunTest(env, TST, BusyPorts, COND, o
 
     if COND:
         for cond in COND.split('&'):
+            if cond[:1] == '!':
+                negate = True
+                cond = cond[1:]
+            else:
+                negate = False
             if cond == 'PREVREL':
                 if not os.path.exists(os.path.join(env['GDK_DBFARM'], 
'prevrel.zip')):
                     reason = "as previous release database is not available"
@@ -1767,8 +1780,11 @@ def RunTest(env, TST, BusyPorts, COND, o
                 reason = "as conditional '%s' is unknown." % cond
                 elem = SkipTest(env, TST, EXT, reason, length)
                 break
-            elif not CONDITIONALS[cond]:
-                reason = "as conditional '%s' does not hold." % cond
+            elif (not CONDITIONALS[cond]) != negate:
+                if negate:
+                    reason = "as conditional '%s' holds." % cond
+                else:
+                    reason = "as conditional '%s' does not hold." % cond
                 elem = SkipTest(env, TST, EXT, reason, length)
                 break
     if reason:
_______________________________________________
Checkin-list mailing list
Checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to