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

Test cases broken when builddir != srcdir

From: Mo DeJong <supermo_at_bayarea.net>
Date: 2001-09-15 02:12:56 CEST

Hi all.

I tried to run the automated test cases in a builddir that is not the srcdir
and hit a wall. Some of the test case shell scripts are written to assume
that the builddir is the same as the srcdir. In addition, there are some
really nasty chmod hacks in the toplevel Makefile that don't work.
How should we fix this? There are a couple of approaches we could try.

1. Leave the .sh scripts in the srcdir and pass in the builddir.
2. Copy the .sh scripts into the builddir and pass in the srcdir.
3. Do some cute trick like storing the srcdir or builddir in a file
    that the scripts know how to access with a relative path.

I took a quick hack at option #2 minus the changes to the actual .sh
files. Does this look reasonable to folks?

Cheers
Mo

Index: Makefile.in
===================================================================
--- SVN/text-base/Makefile.in Mon Sep 10 09:49:53 2001
+++ Makefile.in Fri Sep 14 17:00:49 2001
@@ -104,22 +104,28 @@
 
 local-install: @INSTALL_RULES@
 
-### the chmod really sucks, but some repository files don't have it like
-### they should ...
 check: $(TEST_DEPS) @FS_TEST_DEPS@
         @logfile=`pwd`/tests.log ; \
         echo > $$logfile ; \
         failed=no ; \
         list='$(TEST_PROGRAMS) @FS_TEST_PROGRAMS@'; for prog in $$list; do \
- chmod a+x $$prog ; \
             progbase=`echo $$prog | sed 's?.*/??'` ; \
             progdir=`echo $$prog | sed 's?/[^/]*$$??'` ; \
             echo -n "Running all tests in $$progbase..." ; \
             echo "START: $$progbase" >> $$logfile ; \
             if echo $$prog | grep \.py > /dev/null; then \
                 runprog="$(PYTHON) $$progbase" ; \
- else \
- runprog="./$$progbase" ; \
+ elif test -x $$prog ; then \
+ runprog="./$$progbase" ; \
+ elif test ! -f $$prog && test -f $(top_srcdir)/$$prog ; then \
+ $(MKDIR) $$progdir ; \
+ cp $(top_srcdir)/$$prog $$progdir ;\
+ runprog="$(SHELL) $$progbase" ; \
+ elif test -f $$prog ; then \
+ runprog="$(SHELL) $$progbase" ; \
+ else \
+ echo "Don't know what to do about $$progbase" ; \
+ exit 1 ; \
             fi ; \
             if ( cd $$progdir && $$runprog ) >> $$logfile ; then \
                 echo "SUCCESS" ; \

---------------------------------------------------------------------
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:41 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.