Re: [PATCH v5 10/12] tests: when run in Bash, annotate test failures with file name/line number

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

 



Danh Doan <congdanhqx@xxxxxxxxx> writes:

>> > +file_lineno () {
>> > +	test -z "$GIT_TEST_FRAMEWORK_SELFTEST" && test -n "$BASH" || return 0
>> > +	local i
>> > +	for i in ${!BASH_SOURCE[*]}
>> 
>> this line breaks with NetBSD's sh (and probably other POSIX complaint shells)
>>  ...
> This function will be called in CI only, and when the the shell used
> is bash, to annotate the faulty line.
>
> We have a test guarding it already.

Carlo, you said "this line breaks"---implying that you actually saw
breakage when running our tests on affected platforms.  Is that the
case?

It is entirely possible that some shell implementations may try to
parse the contents of the shell function and trigger a syntax error
on that line, even before evaluationg "are we running tests and do
we have BASH set?", so I can believe "we have a test guarding", if
the mention refers to the first line of the helper function, is
insufficient and does break with some shells.







[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux