[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

running 'make check' when builddir != srcdir

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2002-01-17 02:02:08 CET

Hello

I really prefer using builddir != srcdir. Aside from keeping all the
build rubbish out of the source tree, it also allows the use of
multiple builddirs with the same srcdir, so one shared and one static
say, or one debug and one optimised.

However the big drawback is that 'make check' doesn't work, it falls
over on the shell/python tests that are run out of the srcdir. First
the 'chmod a+x' commands fail, second the 'cd' commands fail and third
the scripts are not found.

I don't know how to tweak build.conf to create the missing
directories, however I can create them by hand for now. The following
patch allows nearly everything else to work. Only update_tests.py
fails as it cannot locate theta.png. Suggestions/solutions to these
problems are welcome.

Does anyone object to the following patch?

* Makefile.in: Use full path to scripts in check target.

* subversion/tests/clients/cmdline/xmltests/svn-test.sh: Accept two optional
  parameters to define paths into builddir and srcdir.

* subversion/tests/clients/cmdline/xmltests/svn-test2.sh: Accept two optional
  parameters to define paths into builddir and srcdir.

Index: ./Makefile.in
===================================================================
--- ./Makefile.in
+++ ./Makefile.in Thu Jan 17 00:40:31 2002
@@ -117,15 +117,19 @@
         echo > $$logfile ; \
         failed=no ; \
         list='$(TEST_PROGRAMS) @FS_TEST_PROGRAMS@'; for prog in $$list; do \
- chmod a+x $$prog ; \
+ if test -e $$prog; then \
+ chmod a+x $$prog ; \
+ else \
+ chmod a+x $(abs_srcdir)/$$prog ; \
+ fi ; \
             progbase=`echo $$prog | sed 's?.*/??'` ; \
             progdir=`echo $$prog | sed 's?/[^/]*$$??'` ; \
             echo -n "Running all tests in $$progbase..." ; \
             echo "START: $$progbase" >> $$logfile ; \
             if echo $$progbase | grep \\.py$$ > /dev/null; then \
- runprog="$(PYTHON) $$progbase" ; \
+ runprog="$(PYTHON) $(abs_srcdir)/$$prog" ; \
             elif echo $$progbase | grep \\.sh$$ > /dev/null; then \
- runprog="$(SHELL) $$progbase" ; \
+ runprog="$(SHELL) $(abs_srcdir)/$$prog $(abs_builddir)/$$progdir $(abs_srcdir)/$$progdir" ; \
             elif test -x $$prog ; then \
                 runprog="./$$progbase" ; \
             else \
Index: ./subversion/tests/clients/cmdline/xmltests/svn-test.sh
===================================================================
--- ./subversion/tests/clients/cmdline/xmltests/svn-test.sh
+++ ./subversion/tests/clients/cmdline/xmltests/svn-test.sh Wed Jan 16 23:45:02 2002
@@ -1,7 +1,15 @@
 #!/bin/sh
 
 SVN_PROG=../../../../clients/cmdline/svn
+SVN_PROG_UP=../${SVN_PROG}
 XML_DIR=../../../xml
+if [ "x${1}" != "x" ]; then
+ SVN_PROG=${1}/${SVN_PROG}
+ SVN_PROG_UP=${SVN_PROG}
+fi
+if [ "x${2}" != "x" ]; then
+ XML_DIR=${2}/${XML_DIR}
+fi
 TEST_DIR_1=t1
 TEST_DIR_2=t2
 COMMIT_RESULTFILE_NAME=commit
@@ -75,7 +83,7 @@
 ### Commit.
 echo "Committing changes in ${TEST_DIR_1}."
 (cd ${TEST_DIR_1}; \
- ../${SVN_PROG} commit --xml-file ../${COMMIT_RESULTFILE_NAME}-2.xml \
+ ${SVN_PROG_UP} commit --xml-file ../${COMMIT_RESULTFILE_NAME}-2.xml \
                 --revision 2; \
  )
 
@@ -84,7 +92,7 @@
 ### Update.
 echo "Updating ${TEST_DIR_2} from changes in ${TEST_DIR_1}."
 (cd ${TEST_DIR_2}; \
- ../${SVN_PROG} update --xml-file ../${COMMIT_RESULTFILE_NAME}-2.xml \
+ ${SVN_PROG_UP} update --xml-file ../${COMMIT_RESULTFILE_NAME}-2.xml \
                 --revision 2; \
  )
 
@@ -116,7 +124,7 @@
 ### Commit.
 echo "Committing changes, this time from ${TEST_DIR_2}."
 (cd ${TEST_DIR_2}; \
- ../${SVN_PROG} commit --xml-file ../${COMMIT_RESULTFILE_NAME}-3.xml \
+ ${SVN_PROG_UP} commit --xml-file ../${COMMIT_RESULTFILE_NAME}-3.xml \
                 --revision 3; \
  )
 
@@ -126,7 +134,7 @@
 ### Update.
 echo "Updating ${TEST_DIR_1} from changes in ${TEST_DIR_2}."
 (cd ${TEST_DIR_1}; \
- ../${SVN_PROG} update --xml-file ../${COMMIT_RESULTFILE_NAME}-3.xml \
+ ${SVN_PROG_UP} update --xml-file ../${COMMIT_RESULTFILE_NAME}-3.xml \
                 --revision 3; \
  )
 
@@ -165,7 +173,7 @@
 ### Commit.
 echo "Committing changes for merge, from ${TEST_DIR_1}."
 (cd ${TEST_DIR_1}; \
- ../${SVN_PROG} commit --xml-file ../${COMMIT_RESULTFILE_NAME}-4.xml \
+ ${SVN_PROG_UP} commit --xml-file ../${COMMIT_RESULTFILE_NAME}-4.xml \
                 --revision 4; \
  )
 
@@ -175,7 +183,7 @@
 ### Update.
 echo "Updating ${TEST_DIR_2}, merging changes from ${TEST_DIR_1}."
 (cd ${TEST_DIR_2}; \
- ../${SVN_PROG} update --xml-file ../${COMMIT_RESULTFILE_NAME}-4.xml \
+ ${SVN_PROG_UP} update --xml-file ../${COMMIT_RESULTFILE_NAME}-4.xml \
                 --revision 4; \
  )
 
Index: ./subversion/tests/clients/cmdline/xmltests/svn-test2.sh
===================================================================
--- ./subversion/tests/clients/cmdline/xmltests/svn-test2.sh
+++ ./subversion/tests/clients/cmdline/xmltests/svn-test2.sh Wed Jan 16 23:47:25 2002
@@ -3,7 +3,17 @@
 # Testing merging and conflict resolution.
 
 SVN_PROG=../../../../clients/cmdline/svn
+SVN_PROG_UP=../${SVN_PROG}
 XML_DIR=../../../xml
+XML_DIR_UP=../${XML_DIR}
+if [ "x${1}" != "x" ]; then
+ SVN_PROG=${1}/${SVN_PROG}
+ SVN_PROG_UP=${SVN_PROG}
+fi
+if [ "x${2}" != "x" ]; then
+ XML_DIR=${2}/${XML_DIR}
+ XML_DIR_UP=${XML_DIR}
+fi
 TEST_DIR_1=t1
 TEST_DIR_2=t2
 COMMIT_RESULTFILE_NAME=commit2
@@ -38,14 +48,14 @@
 ### Give t1/iota some file-properties via update.
 echo "Updating t1/iota with properties. (up2.xml)"
 (cd ${TEST_DIR_1}; \
- ../${SVN_PROG} update --xml-file ../$XML_DIR/up2.xml --revision 17)
+ ${SVN_PROG_UP} update --xml-file ${XML_DIR_UP}/up2.xml --revision 17)
 
 check_status 2
 
 ### Give t1/A some dir-properties via update.
 echo "Updating t1/A/ with properties. (up5.xml)"
 (cd ${TEST_DIR_1}; \
- ../${SVN_PROG} update --xml-file ../$XML_DIR/up5.xml --revision 18)
+ ${SVN_PROG_UP} update --xml-file ${XML_DIR}/up5.xml --revision 18)
 
 check_status 3
 
@@ -91,14 +101,14 @@
 ### Update again. This update should create conflicting properties.
 echo "Updating with (conflicting) properties. (up-props.xml)"
 (cd ${TEST_DIR_1}; \
- ../${SVN_PROG} update --xml-file ../$XML_DIR/up-props.xml --revision 20)
+ ${SVN_PROG_UP} update --xml-file ${XML_DIR}/up-props.xml --revision 20)
 
 check_status 9
 
 ### Update again. This update should create conflicting text.
 echo "Updating with (conflicting) text. (pipatch.xml)"
 (cd ${TEST_DIR_1}; \
- ../${SVN_PROG} update --xml-file ../$XML_DIR/pipatch.xml --revision 21)
+ ${SVN_PROG_UP} update --xml-file ${XML_DIR}/pipatch.xml --revision 21)
 
 check_status 10
 

-- 
Philip
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:56 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.