Patchwork [1,of,3,STABLE] tests: choose the path separator in PYTHONPATH suitable for platform

login
register
mail settings
Submitter Katsunori FUJIWARA
Date Nov. 10, 2013, 9:42 a.m.
Message ID <3353f12dbeda17280001.1384076520@juju>
Download mbox | patch
Permalink /patch/2892/
State Accepted
Commit a1f99a7f2d72d21d4f0cfeb6b33f9163a32be9a0
Headers show

Comments

Katsunori FUJIWARA - Nov. 10, 2013, 9:42 a.m.
# HG changeset patch
# User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
# Date 1384069704 -32400
#      Sun Nov 10 16:48:24 2013 +0900
# Branch stable
# Node ID 3353f12dbeda172800010521aa136c9baa918692
# Parent  ba6486076429e5c20d910b8a5d4f8acf1e9dc1b1
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.

Patch

diff --git a/tests/test-extension.t b/tests/test-extension.t
--- a/tests/test-extension.t
+++ b/tests/test-extension.t
@@ -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