diff tests/test-simple4server-bundle2.t @ 2046:994d81caec68

test: update test to check for various way to import the serveronly things We add a "setup script" that update the PYTHONPATH to allow direct import of the extension code. Then we tests that all way to import the extensions works.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Tue, 07 Mar 2017 12:10:05 +0100
parents 202ac6c94b7f
children cbdb68189432
line wrap: on
line diff
--- a/tests/test-simple4server-bundle2.t	Tue Mar 07 12:04:05 2017 +0100
+++ b/tests/test-simple4server-bundle2.t	Tue Mar 07 12:10:05 2017 +0100
@@ -1,3 +1,5 @@
+
+  $ . ${TESTDIR}/testlib/pythonpath.sh
 
   $ cat >> $HGRCPATH <<EOF
   > [defaults]
@@ -17,11 +19,18 @@
   >    hg ci -m "add $1"
   > }
 
+  $ hg init server
+
+Try the multiple ways to setup the extension
+
+  $ hg -R server log --config 'extensions.evolve.serveronly='
+  $ hg -R server log --config "extensions.evolve.serveronly=${SRCDIR}/hgext3rd/evolve/serveronly.py"
+  $ PYTHONPATH=$HGTEST_ORIG_PYTHONPATH hg -R server log --config "extensions.evolve.serveronly=${SRCDIR}/hgext3rd/evolve/serveronly.py"
+
 setup repo
 
-  $ hg init server
   $ echo "[extensions]" >> ./server/.hg/hgrc
-  $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext3rd/evolve/serveronly.py" >> ./server/.hg/hgrc
+  $ echo "evolve.serveronly=" >> ./server/.hg/hgrc
   $ hg serve -R server -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
   $ cat hg.pid >> $DAEMON_PIDS
 
@@ -31,7 +40,7 @@
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ cat ./errors.log
   $ echo "[extensions]" >> ./client/.hg/hgrc
-  $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext3rd/evolve/" >> ./client/.hg/hgrc
+  $ echo "evolve=" >> ./client/.hg/hgrc
   $ cp -r client other
 
 Smoke testing