RE: autotest/AT_CHECK: ways to pass additional options on to diff?

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

 



On Thu, 25 Apr 2019 17:10:11 -0400, Nick Bowler wrote:
> > simply offer
> > autotest a customized script called 'diff' - surprise surprise - the
> > testsuite script finds **first** on PATH.
>
> Yes, that sounds workable.  You can fairly easily generate such a wrapper
> script in configure, too, if for portability you need to test whether diff
> supports some particular option.

Agree - currently the customized diff script should make it possible for me
to run the checks without stopping because of some nasty EOL difference.  So
no need to validate if the diff flags are available, but alternatively the
all-purpose sed could do this job in a preparation step, too.

> I would have one concern about using diff --strip-trailing-cr in test
cases
> however: if the program fails to produce the expected DOS line endings,
the
> diff will not notice this.

This is a subtle point, but the test suites of the packages I am currently
looking at focus on the content only, ignoring any EOLs.

> Assuming the Windows version of a program is intended to produce such line
> endings, these test cases won't be able to tell if the program
accidentally
> produces Unix line endings instead (which might plausibly happen on
> Windows if a C program opens a file in binary mode when text mode was
> required).

Yep, however we could printf to file streams opened with "wb", then '\n'
produces no CR on Windows. This would require fopen be checked and
potentially adjusted in the test suite, but only if EOLs mattered.

> This may or may not be a problem for you.

Alas, no.  I have got enough with the CRLF and other issues because of
sitting between the two worlds.

> Cheers,
>   Nick

Many thanks again for responding quickly and your thoughts!

Best,
J.


_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
https://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