automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

$srcdir


From: Dr. David Kirkby
Subject: $srcdir
Date: Wed, 05 Mar 2003 20:55:46 +0000

I'm sorry I don't really know if this is an automake issue or an
autoconf one, so please excuse the posting to both groups. I'm
confused just how to best refer to files and in particular the use of
$srcdir, which I assumed refereed to the directory 'src' below the top
directory of a package, but seems to be undefined when I try to use
it. Putting 'echo $srcdir' in a test script, just echoes a blank line,
with no directory information. 

If I am right in assuming srcdir is supposed to refer to 'src'
immediately below the top level directory, does that mean I can refer
to the 'tests' directory immediately below the top level directory as
$srcdir/.../tests ?

Incedently, should the test scripts have '#!/bin/sh' on the first
line?

I'm have a package with a directory structure like this:

./examples
./src
./src/non_gui
./src/gui
./tests
./tools
./tools/src

I'd like to run some tests (in the 'tests' directory) that uses

a) A binary called src/non_gui/atlc
b) The tests themselves in tests
c) An example bitmap file, that I first create with one program and
put into an exacmples directory, then test the bitmap file has the
chechsum I expect. 

Test 1 below just does not work, since $srcdir is undefined in the
test script. 

#test1.test
#!/bin/sh
$srcdir/non_gui/create_bmp
$srcdir/../examples/test_stripline_coupler.bmp 
CKSUM=`../tools/src/mycksum ../examples/test_stripline_coupler.bmp`
if [ $CKSUM = 48613 ]; then
  echo "PASSED:" $0 >> tests.log 
  exit 0
else
  echo "FAILED:" $0  >> tests.log
  exit 1
fi

Conversely 'test2.test' below does work, although I'm sure using paths
in this way is not a great idea, easpecially if someone was building
in a different directory to the sources. 

#test2.test
#!/bin/sh
# Compute a value 'Zo' using 'atlc' to analyse the bitmap 
# just created in test1. 
Zo=`../src/non_gui/atlc  ../examples/test_stripline_coupler.bmp`
if [ $Zo = 63.70 ] ; then
  echo "PASSED:" $0 >> tests.log
  exit 0
else
  echo "FAILED:" $0 >> tests.log
  exit 1
fi

-- 
Dr. David Kirkby,
Senior Research Fellow,
Department of Medical Physics,
University College London,
11-20 Capper St, London, WC1E 6JA.
Tel: 020 7679 6408 Fax: 020 7679 6269
Internal telephone: ext 46408
e-mail address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]