You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by da...@apache.org on 2014/05/06 13:12:59 UTC

svn commit: r1592715 - /subversion/trunk/subversion/tests/cmdline/svntest/main.py

Author: danielsh
Date: Tue May  6 11:12:59 2014
New Revision: 1592715

URL: http://svn.apache.org/r1592715
Log:
svntest.main: Allow callers to be in places other than tests/cmdline/.

* subversion/tests/cmdline/svntest/main.py
  (P): New helper, limited in scope to about 20 lines of code.
  (svn_binary, svnadmin_binary, svnlook_binary, svnrdump_binary,
   svnsync_binary, svnversion_binary, svndumpfilter_binary, svnmucc_binary,
   entriesdump_binary, lock_helper_binary, atomic_ra_revprop_change_binary,
   wc_lock_tester_binary, wc_incomplete_tester_binary):
     Compute these relative to this file rather than relative to the cwd.

Modified:
    subversion/trunk/subversion/tests/cmdline/svntest/main.py

Modified: subversion/trunk/subversion/tests/cmdline/svntest/main.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svntest/main.py?rev=1592715&r1=1592714&r2=1592715&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svntest/main.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svntest/main.py Tue May  6 11:12:59 2014
@@ -141,25 +141,28 @@ stack_trace_regexp = r'(?:.*subversion[\
 os.environ['LC_ALL'] = 'C'
 
 ######################################################################
-# The locations of the svn binaries (svn, svnadmin, svnlook and others),
-# relative to the only scripts that import this file right now (they
-# live in ../).
+# The locations of the svn binaries.
 # Use --bin to override these defaults.
-svn_binary = os.path.abspath('../../svn/svn' + _exe)
-svnadmin_binary = os.path.abspath('../../svnadmin/svnadmin' + _exe)
-svnlook_binary = os.path.abspath('../../svnlook/svnlook' + _exe)
-svnrdump_binary = os.path.abspath('../../svnrdump/svnrdump' + _exe)
-svnsync_binary = os.path.abspath('../../svnsync/svnsync' + _exe)
-svnversion_binary = os.path.abspath('../../svnversion/svnversion' + _exe)
-svndumpfilter_binary = os.path.abspath('../../svndumpfilter/svndumpfilter' + \
-                                       _exe)
-svnmucc_binary=os.path.abspath('../../svnmucc/svnmucc' + _exe)
-entriesdump_binary = os.path.abspath('entries-dump' + _exe)
-lock_helper_binary = os.path.abspath('lock-helper' + _exe)
-atomic_ra_revprop_change_binary = os.path.abspath('atomic-ra-revprop-change' + \
-                                                  _exe)
-wc_lock_tester_binary = os.path.abspath('../libsvn_wc/wc-lock-tester' + _exe)
-wc_incomplete_tester_binary = os.path.abspath('../libsvn_wc/wc-incomplete-tester' + _exe)
+def P(relpath,
+      head=os.path.abspath(
+            os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(
+                                                                  __file__)))))
+      ):
+  return os.path.join(head, relpath)
+svn_binary = P('svn/svn')
+svnadmin_binary = P('svnadmin/svnadmin')
+svnlook_binary = P('svnlook/svnlook')
+svnrdump_binary = P('svnrdump/svnrdump')
+svnsync_binary = P('svnsync/svnsync')
+svnversion_binary = P('svnversion/svnversion')
+svndumpfilter_binary = P('svndumpfilter/svndumpfilter')
+svnmucc_binary = P('svnmucc/svnmucc')
+entriesdump_binary = P('tests/cmdline/entries-dump')
+lock_helper_binary = P('tests/cmdline/lock-helper')
+atomic_ra_revprop_change_binary = P('tests/cmdline/atomic-ra-revprop-change')
+wc_lock_tester_binary = P('tests/libsvn_wc/wc-lock-tester')
+wc_incomplete_tester_binary = P('tests/libsvn_wc/wc-incomplete-tester')
+del P
 
 ######################################################################
 # The location of svnauthz binary, relative to the only scripts that