autoconf
[Top][All Lists]
Advanced

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

Re: Autotesting - GNU Autoconf


From: Ralf Wildenhues
Subject: Re: Autotesting - GNU Autoconf
Date: Thu, 6 Apr 2006 08:58:06 +0200
User-agent: Mutt/1.5.11

Hi Randima,

* Randima wrote on Thu, Apr 06, 2006 at 05:13:43AM CEST:
> 
> When writing test suites in testsuite.at for autotesting I would like to
> know how to access the test file names. 
> Do we need to give absolute file names for input test files? If so,
> migrating to another development enviornment would result test case
> failures.

> And what is the recommened way to store test files I have used for
> autotesting. Will it be inside the test directory of the source code?

If the test file contents are small, it's best to integrate them into
the testsuite:

  AT_DATA([syntaxerr],
  [[contents
  of the syntaxerr file
  ]])

Then you can avoid paths completely.  The disadvantage here is that now,
the file is only available in this one test.  If you need it in multiple
tests, you could consider defining a macro that expands to the above, so
you don't need to repeat the contents in the *.at source; but then they
will be repeated in the testsuite.

For larger files, if you need absolute paths, you should use the
variables provided by the `atconfig' file, and use `AC_CONFIG_TESTDIR'.

> AT_DATA([experr],
> [[/import/eno/2/rnsr312/param-0.3/tests/syntaxerr:8.0: syntax error,
> unexpected TOKEN_ID_INT, expecting %% or int or intlist
> educt: Syntax error in file.
> ]])
> AT_CHECK([educt --prettyprint
> /import/eno/2/rnsr312/param-0.3/tests/syntaxerr],[1],,experr,
> [echo Failed],[echo Passed])

For stuff like this you could
  AT_CHECK([educt --prettyprint $at_srcdir/syntaxerr], [1], [], [stderr], 
           [echo Failed], [echo Passed])
  AT_CHECK([grep 'syntaxerr:8.0: syntax error' stderr], [0], [ignore])
  ...

Cheers,
Ralf




reply via email to

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