[Top][All Lists]

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


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

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


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. 

CKSUM=`../tools/src/mycksum ../examples/test_stripline_coupler.bmp`
if [ $CKSUM = 48613 ]; then
  echo "PASSED:" $0 >> tests.log 
  exit 0
  echo "FAILED:" $0  >> tests.log
  exit 1

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. 

# 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
  echo "FAILED:" $0 >> tests.log
  exit 1

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]