[libav-devel] [RFC] fate: remove \r and \n from result in oneline comparison

Måns Rullgård mans at mansr.com
Tue May 15 00:40:49 CEST 2012


Måns Rullgård <mans at mansr.com> writes:

> Måns Rullgård <mans at mansr.com> writes:
>
>> Janne Grunau <janne-libav at jannau.net> writes:
>>
>>> Fixes fate on cross-compiled/wine mingw32 configs. The diff comaprison
>>> ignores space changes too.
>>> ---
>>>  tests/fate-run.sh |    2 +-
>>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/tests/fate-run.sh b/tests/fate-run.sh
>>> index a45e9a9..367b152 100755
>>> --- a/tests/fate-run.sh
>>> +++ b/tests/fate-run.sh
>>> @@ -61,7 +61,7 @@ stddev(){
>>>  }
>>>
>>>  oneline(){
>>> -    val=$(cat "$2")
>>> +    val=$(tr -d '\r\n' < "$2")
>>
>> NAK
>>
>> We should not be doing hacks like this.  They make the code obscure, and
>> it is hard to predict where they will be needed.
>>
>> The systems currently failing are frankensetups which should be fixed to
>> present proper data to the scripts.  For example, they could override
>> the system cat by setting PATH.  We don't use cat on any binary data, so
>> that should work fine.  I verified that all tests pass with this in
>> place of the normal cat:
>>
>> #! /bin/sh
>> /bin/cat "$@" | tr -d '\r'
>
> Another option is to filter out the \r characters with a wrapper around
> wine.  Something like this (untested) should do it:
>
> #! /bin/sh
> wine "$@" | tr -d '\r'
>
> I don't think any of our tests output binary data on stdout so it should
> be safe.  If I'm wrong a about that, a more elaborate script can be used.

Sorry, some of the tests do write binary data on stdout.  Something like
this should work as a wrapper then:

#! /bin/sh
if [ $(basename $1) = avprobe.exe ]; then
    wine "$@" | tr -d '\r'
else
    wine "$@"
fi

-- 
Måns Rullgård
mans at mansr.com


More information about the libav-devel mailing list