Changeset: 84a143aa9b88 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=84a143aa9b88
Modified Files:
        testing/Mtest.py.in
Branch: Mar2018
Log Message:

Put all args processing code close together.


diffs (69 lines):

diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -3707,32 +3707,6 @@ def main(argv) :
     except monet_options.Error:
         sys.exit(1)
 
-    if len(args) == 1 and not os.path.isdir(args[0]):
-        head, tail = os.path.split(args[0])
-        if os.path.isfile(args[0]):
-            head, tst = os.path.split(head)
-            if tst != 'Tests':
-                ErrXit("%s: not a valid test name" % args[0])
-            args = [head]
-            if tail != 'All':
-                for ext in ('_s00.malC', '_p00.malC', '_s00.mal', '_s00.sql',
-                            '_p00.sql', '.MAL.py', '.SQL.py', '.malC', '.mal',
-                            '.sql', '.py', '.R', ''):
-                    # extentions .in and .src are never combined
-                    if tail.endswith(ext + '.in'):
-                        args.append(tail[:-len(ext + '.in')])
-                        break
-                    if tail.endswith(ext + '.src'):
-                        args.append(tail[:-len(ext + '.src')])
-                        break
-                    if tail.endswith(ext):
-                        args.append(tail[:-len(ext)])
-                        break
-                else:
-                    ErrXit("%s: not a valid test name" % args[0])
-        elif head and tail and os.path.isdir(head) and tail != 'Tests' and 
os.path.isdir(os.path.join(head, 'Tests')):
-            args = [head, tail]
-
     config = opts.get('config', '')
     if config:
         config = ' "--config=%s"' % config
@@ -4167,6 +4141,32 @@ def main(argv) :
         testdirs = []
         testlist = []
         dirlist = []
+        if len(args) == 1 and not os.path.isdir(args[0]):
+            head, tail = os.path.split(args[0])
+            if os.path.isfile(args[0]):
+                head, tst = os.path.split(head)
+                if tst != 'Tests':
+                    ErrXit("%s: not a valid test name" % args[0])
+                args = [head]
+                if tail != 'All':
+                    for ext in ('_s00.malC', '_p00.malC', '_s00.mal', 
'_s00.sql',
+                                '_p00.sql', '.MAL.py', '.SQL.py', '.malC', 
'.mal',
+                                '.sql', '.py', '.R', ''):
+                        # extentions .in and .src are never combined
+                        if tail.endswith(ext + '.in'):
+                            args.append(tail[:-len(ext + '.in')])
+                            break
+                        if tail.endswith(ext + '.src'):
+                            args.append(tail[:-len(ext + '.src')])
+                            break
+                        if tail.endswith(ext):
+                            args.append(tail[:-len(ext)])
+                            break
+                    else:
+                        ErrXit("%s: not a valid test name" % args[0])
+            elif head and tail and os.path.isdir(head) and tail != 'Tests' and 
os.path.isdir(os.path.join(head, 'Tests')):
+                args = [head, tail]
+
         if   len(args) == 1:
             if   os.path.isdir(args[0]):
                 d = os.path.realpath(args[0])
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to