Changeset: 6f17457967ed for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6f17457967ed
Removed Files:
        sql/test/Connections/run.all
        sql/test/Update_Delete_action/run.all
Modified Files:
        monetdb5/mal/Tests/run
        monetdb5/scheduler/Tests/oct02.mal
        
monetdb5/tests/BugDay_2005-10-06_4.8/Tests/multiple_servers.SF-914113.MIL.bat
        
monetdb5/tests/BugDay_2005-10-06_4.8/Tests/multiple_servers.SF-914113.MIL.sh
        monetdb5/tests/BugDay_2005-10-06_4.9.3/Tests/monet_daemon.SF-623743
        monetdb5/tests/BugDay_2005-10-06_4.9.3/Tests/monet_daemon.SF-623743.bat
        monetdb5/tests/BugsViaSourgeforce/Tests/ID.905495s.bat
        sql/backends/monet5/embeddedclient.c.in
        sql/test/BugTracker-2010/Tests/Mbedded-crash.Bug-2701
        sql/test/BugTracker-2010/Tests/Mbedded-crash.Bug-2701.bat
        testing/Mtest.py.in
        testing/README
        testing/quicktest
Branch: default
Log Message:

Merge with Feb2013 branch.


diffs (truncated from 367 to 300 lines):

diff --git a/monetdb5/mal/Tests/run b/monetdb5/mal/Tests/run
--- a/monetdb5/mal/Tests/run
+++ b/monetdb5/mal/Tests/run
@@ -3,8 +3,8 @@
 #DBFARM=$PWD/dbfarm
 DBFARM=/ufs/mk/monet5/Linux/var/MonetDB/dbfarm
 DBNAME=test
-#MSERVER="Mtimeout -timeout 123 mserver --dbfarm=$DBFARM --dbname=$DBNAME -c 
All.conf --set monet_prompt="
-MSERVER="valgrind  --leak-check=full --show-reachable=yes --num-callers=20 
mserver5 --dbfarm=$DBFARM --dbname=$DBNAME --set monet_prompt="
+#MSERVER="Mtimeout -timeout 123 mserver --dbpath=$DBFARM/$DBNAME -c All.conf 
--set monet_prompt="
+MSERVER="valgrind  --leak-check=full --show-reachable=yes --num-callers=20 
mserver5 --dbpath=$DBFARM/$DBNAME --set monet_prompt="
 
 echo "Initialize database"
 rm -rf $DBFARM/$DBNAME
diff --git a/monetdb5/scheduler/Tests/oct02.mal 
b/monetdb5/scheduler/Tests/oct02.mal
--- a/monetdb5/scheduler/Tests/oct02.mal
+++ b/monetdb5/scheduler/Tests/oct02.mal
@@ -2,7 +2,7 @@
 #The third step is run it over a pool of replicas
 #This test can be ran manually as follows:
 #1) start merovingian and create/start demo1, demo2
-#2) run this script using mserver5 --dbname=demo3 --set mapi_port=1234
+#2) run this script using mserver5 --dbpath=.../demo3 --set mapi_port=1234
 #
 
 function octopus.tentacle_1():bat[:oid,:int];
diff --git 
a/monetdb5/tests/BugDay_2005-10-06_4.8/Tests/multiple_servers.SF-914113.MIL.bat 
b/monetdb5/tests/BugDay_2005-10-06_4.8/Tests/multiple_servers.SF-914113.MIL.bat
--- 
a/monetdb5/tests/BugDay_2005-10-06_4.8/Tests/multiple_servers.SF-914113.MIL.bat
+++ 
b/monetdb5/tests/BugDay_2005-10-06_4.8/Tests/multiple_servers.SF-914113.MIL.bat
@@ -1,1 +1,1 @@
-@call %MSERVER% --dbname=%TSTDB%
+@call %MSERVER% --dbpath=%GDK_DBFARM%\%TSTDB%
diff --git 
a/monetdb5/tests/BugDay_2005-10-06_4.8/Tests/multiple_servers.SF-914113.MIL.sh 
b/monetdb5/tests/BugDay_2005-10-06_4.8/Tests/multiple_servers.SF-914113.MIL.sh
--- 
a/monetdb5/tests/BugDay_2005-10-06_4.8/Tests/multiple_servers.SF-914113.MIL.sh
+++ 
b/monetdb5/tests/BugDay_2005-10-06_4.8/Tests/multiple_servers.SF-914113.MIL.sh
@@ -1,1 +1,1 @@
-eval "$MSERVER --dbname=$TSTDB"
+eval "$MSERVER --dbpath=$GDK_DBFARM/$TSTDB"
diff --git 
a/monetdb5/tests/BugDay_2005-10-06_4.9.3/Tests/monet_daemon.SF-623743 
b/monetdb5/tests/BugDay_2005-10-06_4.9.3/Tests/monet_daemon.SF-623743
--- a/monetdb5/tests/BugDay_2005-10-06_4.9.3/Tests/monet_daemon.SF-623743
+++ b/monetdb5/tests/BugDay_2005-10-06_4.9.3/Tests/monet_daemon.SF-623743
@@ -2,6 +2,6 @@
 
 NAME="$1"
 
-Mlog   "$MSERVER --dbname=$TSTDB --set monet_daemon=yes"
-eval   "$MSERVER --dbname=$TSTDB --set monet_daemon=yes"
+Mlog   "$MSERVER --dbpath=$GDK_DBFARM/$TSTDB --set monet_daemon=yes"
+eval   "$MSERVER --dbpath=$GDK_DBFARM/$TSTDB --set monet_daemon=yes"
 
diff --git 
a/monetdb5/tests/BugDay_2005-10-06_4.9.3/Tests/monet_daemon.SF-623743.bat 
b/monetdb5/tests/BugDay_2005-10-06_4.9.3/Tests/monet_daemon.SF-623743.bat
--- a/monetdb5/tests/BugDay_2005-10-06_4.9.3/Tests/monet_daemon.SF-623743.bat
+++ b/monetdb5/tests/BugDay_2005-10-06_4.9.3/Tests/monet_daemon.SF-623743.bat
@@ -3,6 +3,6 @@
 
 @set NAME=%1
 
-echo "%MSERVER% --dbname=$TSTDB --set monet_daemon=yes"
-%MSERVER% --dbname=%TSTDB% --set monet_daemon=yes"
+echo "%MSERVER% --dbpath=%GDK_DBFARM%\$TSTDB --set monet_daemon=yes"
+%MSERVER% --dbpath=%GDK_DBFARM%\%TSTDB% --set monet_daemon=yes"
 
diff --git a/monetdb5/tests/BugsViaSourgeforce/Tests/ID.905495s.bat 
b/monetdb5/tests/BugsViaSourgeforce/Tests/ID.905495s.bat
--- a/monetdb5/tests/BugsViaSourgeforce/Tests/ID.905495s.bat
+++ b/monetdb5/tests/BugsViaSourgeforce/Tests/ID.905495s.bat
@@ -5,7 +5,7 @@ set NAME=%1
 prompt # $t $g  
 echo on
 
-call %MSERVER% --dbname=%GDK_DBFARM%\%TSTDB% %NAME%.mal
+call %MSERVER% --dbpath=%GDK_DBFARM%\%TSTDB% %NAME%.mal
 
-call %MSERVER% --dbname=%GDK_DBFARM%\%TSTDB% < %NAME%.mal
+call %MSERVER% --dbpath=%GDK_DBFARM%\%TSTDB% < %NAME%.mal
 
diff --git a/sql/backends/monet5/embeddedclient.c.in 
b/sql/backends/monet5/embeddedclient.c.in
--- a/sql/backends/monet5/embeddedclient.c.in
+++ b/sql/backends/monet5/embeddedclient.c.in
@@ -141,7 +141,7 @@ embedded_sql(opt *set, int len)
 }
 
 Mapi
-monetdb_sql(char *dbfarm, char *dbname)
+monetdb_sql(char *dbpath)
 {
        Mapi mid;
 #if !defined(HAVE_PTHREAD_H) && defined(_MSC_VER)
@@ -155,8 +155,7 @@ monetdb_sql(char *dbfarm, char *dbname)
 
        /* needed, to prevent the MonetDB config file to be used */  
        embedded_len = mo_system_config(&embedded_set, len);
-       embedded_len = mo_add_option(&embedded_set, embedded_len, opt_cmdline, 
"gdk_dbfarm", dbfarm);
-       embedded_len = mo_add_option(&embedded_set, embedded_len, opt_cmdline, 
"gdk_dbname", dbname);
+       embedded_len = mo_add_option(&embedded_set, embedded_len, opt_cmdline, 
"gdk_dbpath", dbpath);
 
        server = mapi_embedded_init(&mid,"sql");
 
diff --git a/sql/test/BugTracker-2010/Tests/Mbedded-crash.Bug-2701 
b/sql/test/BugTracker-2010/Tests/Mbedded-crash.Bug-2701
--- a/sql/test/BugTracker-2010/Tests/Mbedded-crash.Bug-2701
+++ b/sql/test/BugTracker-2010/Tests/Mbedded-crash.Bug-2701
@@ -1,1 +1,1 @@
-echo 'select name from tables where system = false;' | Mbeddedsql5 
--dbfarm="$GDK_DBFARM" --dbname="$TSTDB"
+echo 'select name from tables where system = false;' | Mbeddedsql5 
--dbpath="$GDK_DBFARM/$TSTDB"
diff --git a/sql/test/BugTracker-2010/Tests/Mbedded-crash.Bug-2701.bat 
b/sql/test/BugTracker-2010/Tests/Mbedded-crash.Bug-2701.bat
--- a/sql/test/BugTracker-2010/Tests/Mbedded-crash.Bug-2701.bat
+++ b/sql/test/BugTracker-2010/Tests/Mbedded-crash.Bug-2701.bat
@@ -1,1 +1,1 @@
-@echo select name from tables where system = false; | Mbeddedsql5 
"--dbfarm=%GDK_DBFARM%" "--dbname=%TSTDB%"
+@echo select name from tables where system = false; | Mbeddedsql5 
"--dbpath=%GDK_DBFARM%\%TSTDB%"
diff --git a/sql/test/Connections/run.all b/sql/test/Connections/run.all
deleted file mode 100755
--- a/sql/test/Connections/run.all
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/bin/sh
-
-# The contents of this file are subject to the MonetDB Public License
-# Version 1.1 (the "License"); you may not use this file except in
-# compliance with the License. You may obtain a copy of the License at
-# http://www.monetdb.org/Legal/MonetDBLicense
-#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
-# License for the specific language governing rights and limitations
-# under the License.
-#
-# The Original Code is the MonetDB Database System.
-#
-# The Initial Developer of the Original Code is CWI.
-# Portions created by CWI are Copyright (C) 1997-July 2008 CWI.
-# Copyright August 2008-2012 MonetDB B.V.
-# All Rights Reserved.
-
-PWD=`pwd`
-echo $PWD
-SQL='mclient -p50000 -lsql -umonetdb -Pmonetdb'
-
-if [ $# -eq 1 ]; then
-       SQL=$1
-fi
-
-#Generate Data...
-
-#Bulk-Load into SQL server...
-mserver5 --dbname=demo --set mapi_port=50000 --daemon=yes &
-mserver5 --dbname=demo2 --set mapi_port=40000 --daemon=yes &
-sleep 5
-
-echo syntax
-cat connections_syntax.sql | sed -e 's/port_num/40000/g' | $SQL 
-
-echo semantic
-cat connections_semantic.sql | sed -e 's/port_num/40000/g' | $SQL 
-
-echo default values
-cat connections_default_values.sql | sed -e 's/port_num/40000/g' | $SQL 
diff --git a/sql/test/Update_Delete_action/run.all 
b/sql/test/Update_Delete_action/run.all
deleted file mode 100755
--- a/sql/test/Update_Delete_action/run.all
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/bin/sh
-
-# The contents of this file are subject to the MonetDB Public License
-# Version 1.1 (the "License"); you may not use this file except in
-# compliance with the License. You may obtain a copy of the License at
-# http://www.monetdb.org/Legal/MonetDBLicense
-#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
-# License for the specific language governing rights and limitations
-# under the License.
-#
-# The Original Code is the MonetDB Database System.
-#
-# The Initial Developer of the Original Code is CWI.
-# Portions created by CWI are Copyright (C) 1997-July 2008 CWI.
-# Copyright August 2008-2012 MonetDB B.V.
-# All Rights Reserved.
-
-PWD=`pwd`
-echo $PWD
-SQL='mclient -p$MAPIPORT -lsql -umonetdb -Pmonetdb'
-M5='mserver5 --dbname=demo --set mapi_port=$MAPIPORT'
-if [ $# -eq 1 ]; then
-       SQL=$1
-fi
-
-#Generate Data...
-
-#Bulk-Load into SQL server...
-
-echo delete_cascade
-$SQL < Test/delete_cascade.sql
-
-echo delete_no_action
-$SQL < Test/delete_no_action.sql
-
-echo delete_restrict
-$SQL < Test/delete_restrict.sql
-
-echo delete_set_default
-$SQL < Test/delete_set_default.sql
-
-echo delete_set_null
-$SQL < Test/delete_set_null.sql
-
-echo update_cascade
-$SQL < Test/update_cascade.sql
-
-echo update_delete_cascade
-$SQL < Test/update_delete_cascade.sql
-
-echo update_delete_set_null
-$SQL < Test/update_delete_set_null.sql
-
-echo update_no_action
-$SQL < Test/update_no_action.sql
-
-echo update_restrict
-$SQL < Test/update_restrict.sql
-
-echo update_set_default
-$SQL < Test/update_set_default.sql
-
-echo update_set_null
-$SQL < Test/update_set_null.sql
-
diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -58,7 +58,10 @@ quiet = False
 
 releaserun = False
 
-if os.name != 'nt' and os.isatty(sys.stdout.fileno()):
+# whether output goes to a tty
+isatty = os.isatty(sys.stdout.fileno())
+
+if os.name != 'nt' and isatty:
     # color output a little
     RED = '\033[1;31m'
     GREEN = '\033[0;32m'
@@ -161,6 +164,26 @@ except ImportError:
             p += os.pathsep + os.environ['PYTHONPATH']
         os.environ['PYTHONPATH'] = p
 
+ttywidth = 0
+if os.name != 'nt' and isatty and os.isatty(sys.stdin.fileno()):
+    try:
+        proc = subprocess.Popen(['stty', '-a'], stdout = subprocess.PIPE,
+                                stderr = subprocess.PIPE)
+    except OSError:
+        pass
+    else:
+        out, err = proc.communicate()
+        res = re.search('columns ([0-9]+)', out)
+        if res is not None:
+            ttywidth = int(res.group(1))
+        else:
+            res = re.search(' ([0-9]+) columns', out)
+            if res is not None:
+                ttywidth = int(res.group(1))
+        if ttywidth < 60:
+            # rediculously narrow tty, ignore value
+            ttywidth = 0
+
 import string                   # for whitespace
 def splitcommand(cmd):
     '''Like string.split, except take quotes into account.'''
@@ -1031,7 +1054,17 @@ def SkipTest(env, TST, EXT, REASON, leng
             REASON = REASON[3:]
         if REASON.endswith('.'):
             REASON = REASON[:-1]
-        STDOUT.write('%s%-*s skipped (%s)\n' % (prompt(), length, TST, REASON))
+        if length + 10 + len(REASON) + 11 > ttywidth:
+            # 10 - length of prompt()
+            # 11 - length of " skipped ()"
+            l = ttywidth - 10 - 11 - len(REASON)
+            if len(TST) <= l:
+                s = '%-*s' % (l, TST)
+            else:
+                s = '%s...%s' % (TST[:l/2 - 2], TST[-(l/2 - 1):])
+        else:
+            s = '%-*s' % (length, TST)
+        STDOUT.write('%s%s skipped (%s)\n' % (prompt(), s, REASON))
 
     if testweb:
         return None
@@ -2570,8 +2603,18 @@ def DoIt(env, SERVER, CALL, TST, EXT, PR
                      (prompt(), os.path.join(env['TSTDIR'], TST + EXT),
                       PRELUDE and PRELUDE[0] or '', TIMEOUT, CTIMEOUT, 
STIMEOUT))
     else:
-        STDOUT.write('%s%-*s ' % (prompt(), length, TST))
-        if os.isatty(STDOUT.fileno()):
+        if ttywidth > 0 and length + 10 + 21 > ttywidth:
+            # 10 - length of prompt()
+            # 21 - length of time plus result
+            l = ttywidth - 10 - 21 - 1
+            if len(TST) <= l:
_______________________________________________
checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to