Re: Autotesting - GNU Autoconf

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

 



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


_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux