Changeset: 66c81a601b38 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=66c81a601b38
Modified Files:
        sql/test/mapi/Tests/python2_test_monetdb_sql.SQL.bat
        sql/test/mapi/Tests/python2_test_monetdb_sql.SQL.sh
        sql/test/mapi/Tests/python3_test_monetdb_sql.SQL.bat
        sql/test/mapi/Tests/python3_test_monetdb_sql.SQL.sh
        testing/Mtest.py.in
Branch: Oct2012
Log Message:

Mtest/python: export PYTHON{2,3}PATH for tests to use

Since Mtest can only run with one Python interpreter, the PYTHONPATH it
builds and exports cannot always be right if we're running a specific
python version.  Hence, export PYTHON2PATH and PYTHON3PATH such that we
can override the PYTHONPATH manually, discarding incompatible python
code for the python interpreter being used.


diffs (69 lines):

diff --git a/sql/test/mapi/Tests/python2_test_monetdb_sql.SQL.bat 
b/sql/test/mapi/Tests/python2_test_monetdb_sql.SQL.bat
--- a/sql/test/mapi/Tests/python2_test_monetdb_sql.SQL.bat
+++ b/sql/test/mapi/Tests/python2_test_monetdb_sql.SQL.bat
@@ -3,7 +3,9 @@
 rem must be aligned with the installation directory chosen in
 rem clients/python/test/Makefile.ag
 set testpath=%TSTSRCBASE%\..\clients\python2\test
-set PYTHONPATH=%testpath%;%PYTHONPATH%
+rem ignore PYTHONPATH from Mtest, it is hardcoded to the dirs for the
+rem Python that runs Mtest (currently always Python 2)
+set PYTHONPATH=%testpath%;%PYTHON2PATH%
 
 prompt # $t $g  
 echo on
diff --git a/sql/test/mapi/Tests/python2_test_monetdb_sql.SQL.sh 
b/sql/test/mapi/Tests/python2_test_monetdb_sql.SQL.sh
--- a/sql/test/mapi/Tests/python2_test_monetdb_sql.SQL.sh
+++ b/sql/test/mapi/Tests/python2_test_monetdb_sql.SQL.sh
@@ -3,7 +3,9 @@
 # must be aligned with the installation directory chosen in
 # clients/python/test/Makefile.ag
 testpath="$TSTSRCBASE/../clients/python2/test"
-PYTHONPATH=$testpath:$PYTHONPATH
+# ignore PYTHONPATH from Mtest, it is hardcoded to the dirs for the
+# Python that runs Mtest (currently always Python 2)
+PYTHONPATH=$testpath:${PYTHON2PATH}
 export PYTHONPATH
 
 Mlog -x "${PYTHON2} $testpath/runtests.py"
diff --git a/sql/test/mapi/Tests/python3_test_monetdb_sql.SQL.bat 
b/sql/test/mapi/Tests/python3_test_monetdb_sql.SQL.bat
--- a/sql/test/mapi/Tests/python3_test_monetdb_sql.SQL.bat
+++ b/sql/test/mapi/Tests/python3_test_monetdb_sql.SQL.bat
@@ -3,7 +3,9 @@
 rem must be aligned with the installation directory chosen in
 rem clients/python/test/Makefile.ag
 set testpath=%TSTSRCBASE%\..\clients\python3\test
-set PYTHONPATH=%testpath%;%PYTHONPATH%
+rem ignore PYTHONPATH from Mtest, it is hardcoded to the dirs for the
+rem Python that runs Mtest (currently always Python 2)
+set PYTHONPATH=%testpath%;%PYTHON3PATH%
 
 prompt # $t $g  
 echo on
diff --git a/sql/test/mapi/Tests/python3_test_monetdb_sql.SQL.sh 
b/sql/test/mapi/Tests/python3_test_monetdb_sql.SQL.sh
--- a/sql/test/mapi/Tests/python3_test_monetdb_sql.SQL.sh
+++ b/sql/test/mapi/Tests/python3_test_monetdb_sql.SQL.sh
@@ -3,7 +3,9 @@
 # must be aligned with the installation directory chosen in
 # clients/python/test/Makefile.ag
 testpath="$TSTSRCBASE/../clients/python3/test"
-PYTHONPATH=$testpath:$PYTHONPATH
+# ignore PYTHONPATH from Mtest, it is hardcoded to the dirs for the
+# Python that runs Mtest (currently always Python 2)
+PYTHONPATH=$testpath:${PYTHON3PATH}
 export PYTHONPATH
 
 Mlog -x "${PYTHON3} $testpath/runtests.py"
diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -1164,7 +1164,9 @@ def PerformDir(env, testdir, testlist, B
     os.environ['TSTTRGDIR'] = TSTTRGDIR
     os.environ['RELSRCDIR'] = env['RELSRCDIR']
     os.environ['PYTHON2']   = '@PYTHON2@'
+    os.environ['PYTHON2PATH'] = _configure(os.path.join('@QXprefix@', 
'@PYTHON2_LIBDIR@'))
     os.environ['PYTHON3']   = '@PYTHON3@'
+    os.environ['PYTHON3PATH'] = _configure(os.path.join('@QXprefix@', 
'@PYTHON3_LIBDIR@'))
 
     #STDERR.flush()
     #for v in 'RELSRCDIR':
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to