I'm attempting to use Autotest to build a series of regression
tests. To do so, I'll need to do the following:
1. run the program to be tested, having it create a data file
2. run an external program, foo, with the data file as input
3. examine the output or return code of foo
So far, I've gotten this to work with the following in my
testsuite.at file:
m4_define([AT_CHECK_EXTERNAL_FILE], [
AT_SETUP()
AT_KEYWORDS(add)
AT_CHECK([add -4 -5], [], [stdout])
AT_CHECK([fgrep -x --file=../../test3/expected_output.txt stdout],
[], [ignore])
AT_CLEANUP
])
Here, 'add' is just a simple test program that returns the sum of any
arguments given to it. The file expected_output.txt contains '9'.
I've two problems with the above code: first, the relative pathname
("../../test3/...") just feels clunky and fragile to me. Secondly,
the above code does cannot find the required file
(expected_output.txt) when doing an out-of-place build, i.e. 'make
distcheck'.
Could someone point me in the right direction as to how to make this
better? I've been over the Goat Book, the info files, mailing list
archives, all to no avail. (I'd be happy to add to the Autotest
documentation clarifying the above issue, by the way . . .)
Thanks!!
--
Nathaniel D. Sizemore, Technical Staff
Tech-X Corporation | 5621 Arapahoe Ave Suite A | Boulder, CO 80303
E: sizemore@xxxxxxxxxx P: (720) 974-1846 W: http://www.txcorp.com
_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf