tests: choose the path separator in PYTHONPATH suitable for platform stable
authorFUJIWARA Katsunori <foozy@lares.dti.ne.jp>
Sun, 10 Nov 2013 16:48:24 +0900
branchstable
changeset 20001 a1f99a7f2d72
parent 20000 0849d280663e
child 20002 83347ff50134
tests: choose the path separator in PYTHONPATH suitable for platform Before this patch, test code introduced by e3a5922e18c3 into test-extension.t always uses ":" as the path separator in PYTHONPATH. But ";" should be used on Windows. This patch chooses the path separator in PYTHONPATH suitable for platform.
tests/test-extension.t
--- a/tests/test-extension.t	Fri Nov 08 12:35:50 2013 +0100
+++ b/tests/test-extension.t	Sun Nov 10 16:48:24 2013 +0900
@@ -131,6 +131,13 @@
 
 Check "from __future__ import absolute_import" support for external libraries
 
+#if windows
+  $ PATHSEP=";"
+#else
+  $ PATHSEP=":"
+#endif
+  $ export PATHSEP
+
   $ mkdir $TESTTMP/libroot
   $ echo "s = 'libroot/ambig.py'" > $TESTTMP/libroot/ambig.py
   $ mkdir $TESTTMP/libroot/mod
@@ -148,7 +155,7 @@
   > def extsetup():
   >     print 'ambigabs.s=%s' % ambigabs.s
   > EOF
-  $ (PYTHONPATH=$PYTHONPATH:$TESTTMP/libroot; hg --config extensions.loadabs=loadabs.py root)
+  $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}/libroot; hg --config extensions.loadabs=loadabs.py root)
   ambigabs.s=libroot/ambig.py
   $TESTTMP/a
 #endif
@@ -163,7 +170,7 @@
   > def extsetup():
   >     print 'ambigrel.s=%s' % ambigrel.s
   > EOF
-  $ (PYTHONPATH=$PYTHONPATH:$TESTTMP/libroot; hg --config extensions.loadrel=loadrel.py root)
+  $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}/libroot; hg --config extensions.loadrel=loadrel.py root)
   ambigrel.s=libroot/mod/ambig.py
   $TESTTMP/a
 #endif