On 4/16/19, Jannick <thirdedit...@gmx.net> wrote:
> I am wondering if there is an elegant way to pass additional diff options
> on to AT_CHECK in a testsuite - ideally on the level of .ac, .am, .at files
> or alike?
[...]
> configure translates this code snip into the script testsuite where - and
> this is really evil hackery I solemnly confess and I would like to avoid -
> I changed the definition of the variable at_diff.  In my cases the diff
> options are the same for all tests in each of the relevant projects.
>
> I am aware that the test output could be restructured, but this question
> focuses at autoconf, autotest, AT_CHECK and friends. Using a customized
> version of autotest/general.m4 would not be optimal, since the project
> should automatically benefit from updates of autoconf/automake out of the
> box.

Aside from hackery like you describe, I do not believe there is any
built-in way to modify the behaviour of AT_CHECK like this.

But you can just do whatever comparison you want directly in AT_CHECK...
there is no reason to use the built-in diff when it is inadequate for
your test case.

For example, if I want to use 'cmp' instead of 'diff' I might write
(untested):

  AT_CHECK([:; { commands_to_generate_output
  } >stdout && cmp stdout expected_output])

And if I did that a lot I would define a macro for it.

Cheers,
  Nick

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

Reply via email to