Changeset: 0da0d05915eb for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0da0d05915eb
Modified Files:
Branch: default
Log Message:
Merge with Oct2010 branch.
diffs (truncated from 347 to 300 lines):
diff -r 7b85529051e1 -r 0da0d05915eb
pathfinder/benchmarks/Music/mod/MIL/Tests/xq2mil.py
--- a/pathfinder/benchmarks/Music/mod/MIL/Tests/xq2mil.py Tue Sep 28
17:35:55 2010 +0200
+++ b/pathfinder/benchmarks/Music/mod/MIL/Tests/xq2mil.py Wed Sep 29
15:26:14 2010 +0200
@@ -1,18 +1,11 @@
import os
-import string
+from MonetDBtesting import process
-TST = os.environ['TST']
-TSTDB = os.environ['TSTDB']
TSTSRCDIR = os.environ['TSTSRCDIR']
XQ = os.path.join('XQ','Tests')
MIL = os.path.join('MIL','Tests')
-PF = os.environ['PF']
-CALL = '%s -M "%s.xq" > music.mil' %
(PF,os.path.join(TSTSRCDIR.replace(MIL,XQ),'music'))
-
-import sys, time
-Mlog = "\n%s %s\n\n" % (time.strftime('# %H:%M:%S
>',time.localtime(time.time())), CALL)
-sys.stdout.write(Mlog)
-sys.stderr.write(Mlog)
-
-os.system(CALL)
+pf = process.pf(args = ['-M', '%s.xq' % os.path.join(TSTSRCDIR.replace(MIL,XQ),
+ 'music')],
+ stdout = open('music.mil', 'w'), log = True)
+pf.communicate()
diff -r 7b85529051e1 -r 0da0d05915eb
pathfinder/benchmarks/XMark/mod/MIL/Tests/xq2mil.py
--- a/pathfinder/benchmarks/XMark/mod/MIL/Tests/xq2mil.py Tue Sep 28
17:35:55 2010 +0200
+++ b/pathfinder/benchmarks/XMark/mod/MIL/Tests/xq2mil.py Wed Sep 29
15:26:14 2010 +0200
@@ -1,18 +1,11 @@
import os
-import string
+from MonetDBtesting import process
-TST = os.environ['TST']
-TSTDB = os.environ['TSTDB']
TSTSRCDIR = os.environ['TSTSRCDIR']
XQ = os.path.join('XQ','Tests')
MIL = os.path.join('MIL','Tests')
-PF = os.environ['PF']
-CALL = '%s -M "%s.xq" > xmark.mil' %
(PF,os.path.join(TSTSRCDIR.replace(MIL,XQ),'xmark'))
-
-import sys, time
-Mlog = "\n%s %s\n\n" % (time.strftime('# %H:%M:%S
>',time.localtime(time.time())), CALL)
-sys.stdout.write(Mlog)
-sys.stderr.write(Mlog)
-
-os.system(CALL)
+pf = process.pf(args = ['-M', '%s.xq' % os.path.join(TSTSRCDIR.replace(MIL,XQ),
+ 'xmark')],
+ stdout = open('xmark.mil', 'w'), log = True)
+pf.communicate()
diff -r 7b85529051e1 -r 0da0d05915eb
pathfinder/runtime/Tests/serialization-mclient.XQUERY.py
--- a/pathfinder/runtime/Tests/serialization-mclient.XQUERY.py Tue Sep 28
17:35:55 2010 +0200
+++ b/pathfinder/runtime/Tests/serialization-mclient.XQUERY.py Wed Sep 29
15:26:14 2010 +0200
@@ -1,7 +1,7 @@
import os
import sys
+from MonetDBtesting import process
-XQUERY_CLIENT = os.environ['XQUERY_CLIENT']
query = os.path.join(os.environ['TSTSRCDIR'],'serialization-query.xq')
query_no_attr =
os.path.join(os.environ['TSTSRCDIR'],'serialization-query_no_attr.xq')
@@ -10,7 +10,11 @@
sys.stderr.write('\nmode="%s"\n' % mode)
sys.stdout.flush()
sys.stderr.flush()
- os.system('%s -f%s "%s"' % (XQUERY_CLIENT, mode, query))
+ c = process.client(lang = 'xquery', args = ['-f%s' % mode, query],
+ stdout = process.PIPE, stderr = process.PIPE)
+ out, err = c.communicate()
+ sys.stdout.write(out)
+ sys.stderr.write(err)
sys.stdout.flush()
sys.stderr.flush()
@@ -19,7 +23,11 @@
sys.stderr.write('\nmode="%s" (w/o top-level attribute)\n' % mode)
sys.stdout.flush()
sys.stderr.flush()
-os.system('%s -f%s "%s"' % (XQUERY_CLIENT, mode, query_no_attr))
+c = process.client(lang = 'xquery', args = ['-f%s' % mode, query_no_attr],
+ stdout = process.PIPE, stderr = process.PIPE)
+out, err = c.communicate()
+sys.stdout.write(out)
+sys.stderr.write(err)
sys.stdout.flush()
sys.stderr.flush()
@@ -27,7 +35,10 @@
sys.stderr.write('\nmode="" (default)\n')
sys.stdout.flush()
sys.stderr.flush()
-os.system('%s "%s"' % (XQUERY_CLIENT, query))
+c = process.client(lang = 'xquery', args = [query],
+ stdout = process.PIPE, stderr = process.PIPE)
+out, err = c.communicate()
+sys.stdout.write(out)
+sys.stderr.write(err)
sys.stdout.flush()
sys.stderr.flush()
-
diff -r 7b85529051e1 -r 0da0d05915eb pathfinder/tests/BugTracker/Tests/mps0.py
--- a/pathfinder/tests/BugTracker/Tests/mps0.py Tue Sep 28 17:35:55 2010 +0200
+++ b/pathfinder/tests/BugTracker/Tests/mps0.py Wed Sep 29 15:26:14 2010 +0200
@@ -1,16 +1,10 @@
import os
-import string
+from MonetDBtesting import process
-TST = os.environ['TST']
-TSTDB = os.environ['TSTDB']
-MSERVER = os.environ['MSERVER'].replace('--trace','')
-PF = os.environ['PF']
-
-CALL = '%s -M "%s.xq" | %s --dbname=%s "--dbinit=module(pathfinder);
debugmask(and(debugmask(),xor(INT_MAX,8+2)));"' % (PF,TST,MSERVER,TSTDB)
-
-import sys, time
-Mlog = "\n%s %s\n\n" % (time.strftime('# %H:%M:%S
>',time.localtime(time.time())), CALL)
-sys.stdout.write(Mlog)
-sys.stderr.write(Mlog)
-
-os.system(CALL)
+pf = process.pf(args = ['-M', '%s.xq' % os.environ['TST']],
+ stdout = process.PIPE, log = True)
+srv = process.server(lang = 'xquery',
+ dbinit = 'module(pathfinder);
debugmask(and(debugmask(),xor(INT_MAX,8+2)));',
+ stdin = pf.stdout, log = True, notrace = True)
+pf.communicate()
+srv.communicate()
diff -r 7b85529051e1 -r 0da0d05915eb
pathfinder/tests/BugTracker/Tests/pf-O0_produces_wrong_MIL.SF-1771532.py
--- a/pathfinder/tests/BugTracker/Tests/pf-O0_produces_wrong_MIL.SF-1771532.py
Tue Sep 28 17:35:55 2010 +0200
+++ b/pathfinder/tests/BugTracker/Tests/pf-O0_produces_wrong_MIL.SF-1771532.py
Wed Sep 29 15:26:14 2010 +0200
@@ -1,16 +1,9 @@
import os
-import string
+from MonetDBtesting import process
-TST = os.environ['TST']
-TSTDB = os.environ['TSTDB']
-MSERVER = os.environ['MSERVER'].replace('--trace','')
-PF = os.environ['PF']
-
-CALL = '%s -O0 "%s.xq" | %s --dbname=%s "--dbinit=module(pathfinder);"' %
(PF,TST,MSERVER,TSTDB)
-
-import sys, time
-Mlog = "\n%s %s\n\n" % (time.strftime('# %H:%M:%S
>',time.localtime(time.time())), CALL)
-sys.stdout.write(Mlog)
-sys.stderr.write(Mlog)
-
-os.system(CALL)
+pf = process.pf(args = ['-O0', '%s.xq' % os.environ['TST']],
+ stdout = process.PIPE, log = True)
+srv = process.server(lang = 'xquery', stdin = pf.stdout,
+ log = True, notrace = True)
+pf.communicate()
+srv.communicate()
diff -r 7b85529051e1 -r 0da0d05915eb
pathfinder/tests/BugTracker/Tests/port_busy.SF-1809586.py
--- a/pathfinder/tests/BugTracker/Tests/port_busy.SF-1809586.py Tue Sep 28
17:35:55 2010 +0200
+++ b/pathfinder/tests/BugTracker/Tests/port_busy.SF-1809586.py Wed Sep 29
15:26:14 2010 +0200
@@ -1,4 +1,4 @@
-import os, sys, socket
+import os, sys, socket, time
from MonetDBtesting import process
def prog(dbinit, input):
@@ -8,13 +8,12 @@
stdin = process.PIPE,
stdout = process.PIPE,
stderr = process.PIPE)
+ time.sleep(2)
out, err = srv.communicate(input)
sys.stdout.write(out)
sys.stderr.write(err)
def main():
- mserver = os.getenv('MSERVER')
-
# test mapi and pathfinder modules with MAPIPORT busy
sys.stdout.write("MAPIPORT\n")
sys.stderr.write("MAPIPORT\n")
diff -r 7b85529051e1 -r 0da0d05915eb
pathfinder/tests/BugTracker/Tests/port_busy.SF-1809586.stable.out
--- a/pathfinder/tests/BugTracker/Tests/port_busy.SF-1809586.stable.out Tue Sep
28 17:35:55 2010 +0200
+++ b/pathfinder/tests/BugTracker/Tests/port_busy.SF-1809586.stable.out Wed Sep
29 15:26:14 2010 +0200
@@ -14,11 +14,11 @@
# Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs; dynamically
linked.
# Detected 7.753 GiB (8324386816 bytes) main-memory.
# Visit http://monetdb.cwi.nl/ for further information.
+!ERROR: MAPIlisten:binding to stream socket (39041) failed
+!OS: Address already in use
print(1);
[ 1 ]
quit();
-!ERROR: MAPIlisten:binding to stream socket (39041) failed
-!OS: Address already in use
module(pathfinder);
# MonetDB Server v4.34.0
# based on GDK v1.34.0
diff -r 7b85529051e1 -r 0da0d05915eb pathfinder/tests/StandOff/StandOff.py
--- a/pathfinder/tests/StandOff/StandOff.py Tue Sep 28 17:35:55 2010 +0200
+++ b/pathfinder/tests/StandOff/StandOff.py Wed Sep 29 15:26:14 2010 +0200
@@ -22,19 +22,12 @@
# Rights Reserved.
import os
-import string
+from MonetDBtesting import process
-TST = os.environ['TST']
-TSTDB = os.environ['TSTDB']
-MSERVER = os.environ['MSERVER'].replace('--trace','')
-TSTSRCDIR = os.environ['TSTSRCDIR']
-PF = os.environ['PF']
-
-CALL = '%s -b "%s.xq" | %s --set standoff=enabled --dbname=%s
"--dbinit=module(pathfinder);"' % (PF,os.path.join(TSTSRCDIR,TST),MSERVER,TSTDB)
-
-import sys, time
-Mlog = "\n%s %s\n\n" % (time.strftime('# %H:%M:%S
>',time.localtime(time.time())), CALL)
-sys.stdout.write(Mlog)
-sys.stderr.write(Mlog)
-
-os.system(CALL)
+pf = process.pf(args = ['-b', '%s.xq' % os.path.join(os.environ['TSTSRCDIR'],
+ os.environ['TST'])],
+ stdout = process.PIPE, log = True)
+srv = process.server(lang = 'xquery', args = ['--set', 'standoff=enabled'],
+ stdin = pf.stdout, log = True, notrace = True)
+pf.communicate()
+srv.communicate()
diff -r 7b85529051e1 -r 0da0d05915eb
pathfinder/tests/StandOff/parser/Tests/so-good.py
--- a/pathfinder/tests/StandOff/parser/Tests/so-good.py Tue Sep 28 17:35:55
2010 +0200
+++ b/pathfinder/tests/StandOff/parser/Tests/so-good.py Wed Sep 29 15:26:14
2010 +0200
@@ -1,11 +1,8 @@
import os
-import string
+from MonetDBtesting import process
-TST = os.environ['TST']
-TSTSRCDIR = os.environ['TSTSRCDIR']
-PF = os.environ['PF']
-
-CALL = '%s -b -s1 "%s.xq"' % (PF,os.path.join(TSTSRCDIR,TST))
-
-ret = os.system(CALL)
-print ret
+c = process.pf(args = ['-b', '-s1',
+ '%s.xq' % os.path.join(os.environ['TSTSRCDIR'],
+ os.environ['TST'])])
+c.communicate()
+print c.returncode
diff -r 7b85529051e1 -r 0da0d05915eb testing/src/process.py
--- a/testing/src/process.py Tue Sep 28 17:35:55 2010 +0200
+++ b/testing/src/process.py Wed Sep 29 15:26:14 2010 +0200
@@ -11,6 +11,8 @@
from subprocess import PIPE
+__all__ = ['PIPE', 'Popen', 'client', 'pf', 'server']
+
verbose = False
def splitcommand(cmd):
@@ -43,6 +45,7 @@
_sql_client = splitcommand(os.getenv('SQL_CLIENT', 'mclient -lsql'))
_xquery_client = splitcommand(os.getenv('XQUERY_CLIENT', 'mclient -lxquery
-fxml'))
_sql_dump = splitcommand(os.getenv('SQL_DUMP', 'msqldump -q'))
+_pf_compiler = splitcommand(os.getenv('PF', 'pf'))
_server = splitcommand(os.getenv('MSERVER', ''))
_dotmonetdbfile = []
@@ -134,7 +137,10 @@
stderr = None
if self.stdin:
if input:
- self.stdin.write(input)
+ try:
+ self.stdin.write(input)
+ except IOError:
+ pass
self.stdin.close()
if self.stdout:
stdout = self.stdout.read()
@@ -226,9 +232,51 @@
p.stderr = _BufferedPipe(p.stderr)
return p
+def pf(args = [], stdin = None, stdout = None, stderr = None, log = False):
+ '''Start the pathfinder compiler.'''
+ cmd = _pf_compiler[:]
+ if verbose:
+ print 'Executing', ' '.join(cmd + args)
+ sys.stdout.flush()
+ if log:
+ prompt = time.strftime('# %H:%M:%S > ')
+ cmdstr = ' '.join(cmd + args)
+ if hasattr(stdin, 'name'):
+ cmdstr += ' < "%s"' % stdin.name
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list