ive been converting some cheesy test systems from hand written makefiles to 
autotest and came across an issue with out of tree building and $srcdir ...

my test suite involves running a small program against a list of inputs and 
comparing the output with known good stuff ... since the output can easily be 
a few megs, i couldnt include them in the AT_CHECK() macro directly (causes 
m4 to eat up a lot of resources simply generating the testsuite script, plus 
i doubt bash or any other posix shell appreciate that sort of thing), i 
settled for something like this in tests/testsuite.at:
AT_SETUP([lot])
AT_CHECK([
"$builddir/lot" "$srcdir/lot.input" > lot.out
bzcmp "$srcdir/lot.out.bz2" lot.out
], [0])
AT_CLEANUP

the tests/ subdir looks like:
tests/lot.c (lot is compiled)
tests/lot.input
tests/lot.out.bz2

building in tree works ok, but building out of tree yields:
srcdir="../../tests/../.."

using $top_srcdir/tests/lot.input works though both in and out of tree ...
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.

Attachment: testsuite.log.bz2
Description: BZip2 compressed data

Reply via email to