Update of /cvsroot/monetdb/MonetDB/src/testing
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv1009/src/testing

Modified Files:
        Mtest.py.in 
Log Message:

- enabled -G/--algebra switch also for pathfinder (XQuery)
  (requires upcoming checkin to pathfinder)

  When running `Mtest.py (-G|--algebra)` with a default compilation of 
pathfinder
  (i.e., with the "milprint_summer" back-end being the default), the algebra 
version
  will be used, both for the XQuery to MIL compiler in MonetDB/XQuery 
  (requires upcoming checkin to pathfinder to enable the algebra runtime
   switch for mclient & Mserver), and the stand-alone "pf" compiler
  (via Mtest-provided environment variable "PF", being either "pf" or "pf -A")

- added conditionals WITH_ALGEBRA and NOT_ALGEBRA


NOTE:
(For the time being?) Neither Mtest.py nor mclient provide a command line switch
to disable the algebra back-end; hence, when pathfinder is compiled with the
algebra back-end as default (`configure --with-default-backend=algebra`),
there is no way to (conveniently) switch to using the "milprint_summer" 
back-end,
except using `pf -M` or the "\g" command in an interactive `mclient -lx` 
session.


Index: Mtest.py.in
===================================================================
RCS file: /cvsroot/monetdb/MonetDB/src/testing/Mtest.py.in,v
retrieving revision 1.335
retrieving revision 1.336
diff -u -d -r1.335 -r1.336
--- Mtest.py.in 28 Jan 2008 16:34:46 -0000      1.335
+++ Mtest.py.in 30 Jan 2008 08:55:42 -0000      1.336
@@ -157,6 +157,8 @@
     'HAVE_MONETDB_JAVA': "@HAVE_MONETDB_JAVA_FALSE@",
     'HAVE_MONETDB_JAVAJDBC': "@HAVE_MONETDB_JAVAJDBC_FALSE@",
     'HAVE_MONETDB_JAVAXRPC': "@HAVE_MONETDB_JAVAXRPC_FALSE@",
+    'WITH_ALGEBRA'     : "",
+    'NOT_ALGEBRA'      : "",
 }
 
 # a bunch of classes to help with generating (X)HTML files
@@ -1264,8 +1266,8 @@
         env['TST_FIVE'] = "Five"
         os.environ['TST_FIVE'] = "Five"
     if par['ALGEBRA']:
-        env['TST_ALGEBRA'] = "Algebra"
-        os.environ['TST_ALGEBRA'] = "Algebra"
+        env['TST_ALGEBRA'] = "-G:Algebra"
+        os.environ['TST_ALGEBRA'] = "-G:Algebra"
     return rtrn
 ### GetBitsAndOIDsAndModsAndStatic(env) #
 
@@ -2194,6 +2196,8 @@
             PROLOGUE = " "+TST+".prologue5"
 
         Srvr = '%s%s "--dbname=%s"' % (exe['Mserver'][1], LOCAL_CONF, TSTDB)
+        if par['ALGEBRA']:
+            Srvr += ' --set sql_debug=16384 --set xquery_backend=algebra'
 
         DBINIT=""
         if os.path.isfile(TST+".dbinit") and par['M4']:
@@ -2213,8 +2217,6 @@
             Srvr = '%s "--dbinit=%s"' % (Srvr, DBINIT)
         if SERVER == "SQL":
             lang="sql"
-            if par['ALGEBRA']:
-                Srvr = '%s --set sql_debug=16384' % Srvr
             if par['M5']:
                 Srvr = '%s --set mal_listing=0 "--dbinit=%s include sql;"' % 
(Srvr, DBINIT)
             else:
@@ -2259,6 +2261,8 @@
             killed = RunIt(cmd, "", ClntOut, ClntErr, CTIMEOUT)
         elif CALL in ["mal", "malXs", "milS", "milSXs"]:
             cmd = '%s%s --dbname=%s %s ' % (exe['Mserver'][1], LOCAL_CONF, 
TSTDB, PRELUDE)
+            if par['ALGEBRA']:
+                cmd += ' --set sql_debug=16384 --set xquery_backend=algebra'
             if CALL in ["mal", "milS"]:
                 X=""
             else:
@@ -2819,7 +2823,7 @@
         ('MonetDB5', '5', 'MonetDB5', None,
          "use mserver5 of MonetDB Version 5 (default with <package> in 
{monetdb5, monetdb-datacell})"),
         ('algebra', 'G', 'algebra', None,
-         "use the algebra version of the SQL compiler"),
+         "use the algebra version of the SQL or XQuery compiler"),
         ('recursive', 'r', 'recursive', None,
          "recurse into subdirectories (implies 'All')"),
         ('MONETDB_SOURCE', None, 'MONETDB_SOURCE', '<path>',
@@ -3046,6 +3050,12 @@
         CONDITIONALS['HAVE_MONETDB_JAVA'] = ''
         CONDITIONALS['HAVE_MONETDB_JAVAJDBC'] = ''
         CONDITIONALS['HAVE_MONETDB_JAVAXRPC'] = ''
+    if par['ALGEBRA']:
+        CONDITIONALS['WITH_ALGEBRA'] = '#'
+        CONDITIONALS['NOT_ALGEBRA']  = ''
+    else:
+        CONDITIONALS['WITH_ALGEBRA'] = ''
+        CONDITIONALS['NOT_ALGEBRA']  = '#'
 
     #if env.has_key('MONETDB_PREFIX'):
         #bp = os.path.join(env['MONETDB_PREFIX'],"bin")
@@ -3265,6 +3275,9 @@
         exe['SQL_Dump']      = CheckExec(env['SQLDUMP'].split(None, 1)[0])     
, '%s -umonetdb -Pmonetdb --host=%s --port=%s %s' % (env['SQLDUMP'], HOST, 
env['MAPIPORT'], env['SQL_TRACE'])
         exe['XQuery_Client'] = CheckExec(env['XQUERYCLIENT'].split(None, 
1)[0]), '%s -umonetdb -Pmonetdb --host=%s --port=%s' % (env['XQUERYCLIENT'], 
HOST, env['MAPIPORT'])
         exe['X100_Client']   = CheckExec(env['X100CLIENT'].split(None, 1)[0])  
, '%s -umonetdb -Pmonetdb --host=%s --port=%s' % (env['X100CLIENT'], HOST, 
env['MAPIPORT'])
+        if par['ALGEBRA']:
+            exe['SQL_Client']    = exe['SQL_Client'][0]   , 
exe['SQL_Client'][1]   +' -G'
+            exe['XQuery_Client'] = exe['XQuery_Client'][0], 
exe['XQuery_Client'][1]+' -G'
         if par['TIMEOUT'] == 0 or not exe['Mtimeout'][0]:
             exe['Mtimeout'] = '', ''
         env['exe'] = exe
@@ -3451,6 +3464,23 @@
         if is_pf:
             if not CheckExec('pf'):
                 ErrXit('Stopping Pathfinder testing as XQuery compiler "pf" is 
not available!')
+            if par['ALGEBRA']:
+                env['PF'] = 'pf -A'
+                CONDITIONALS['WITH_ALGEBRA'] = '#'
+                CONDITIONALS['NOT_ALGEBRA']  = ''
+            else:
+                env['PF'] = 'pf'
+                CONDITIONALS['WITH_ALGEBRA'] = ''
+                CONDITIONALS['NOT_ALGEBRA']  = '#'
+                r = re.compile('^\-A, --mil: generate MIL code \(default\)$')
+                proc = subprocess.Popen(['pf','-h'], stdin = subprocess.PIPE, 
stdout = subprocess.PIPE, universal_newlines = True)
+                qOut, qErr = proc.communicate()
+                for l in qOut.split('\n'):
+                    m = r.match(l.strip())
+                    if m:
+                        CONDITIONALS['WITH_ALGEBRA'] = '#'
+                        CONDITIONALS['NOT_ALGEBRA']  = ''
+            os.environ['PF'] = env['PF']
             MissingMods = CheckMods(env, '', 'XQUERY', '')
             if MissingMods:
                 ErrXit('Stopping Pathfinder testing as modules "%s" are 
missing!' % str(MissingMods))


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins

Reply via email to