Re: [Shunit2-users] print file name and line number for each error
Brought to you by:
sfsetse
From: Kate W. <kat...@fo...> - 2008-06-05 22:11:35
|
That will depend on which shell you are using. Could you send me that and I can take a look? Basically what I will look at is passing a custom message with the data you need. If you are using bash, the following should work. Basically, you just need to send a custom message to the assert functions that give the info you need. (note the assertTrue line is one long line; there are 3 lines listed total below) expect=1999 result=`date '+%Y'` assertTrue "$0:${BASH_LINENO:-}: ASSERT: expected:<${expect}> but was :<${result}>" ${expect} ${result} Getting this to be automatic might work by modifying each method in the shUnit2 library to give such output. I'll have to look into that, so I will take this as a feature request. - kate On Tue, Jun 3, 2008 at 11:06 PM, Olexiy Buyanskyy <ol...@gm...> wrote: > Hi, > > Is it possible to print line number and file name for each error? > > mytest.sh:15: ASSERT: It's not 1999 :-( This is 2008. expected:<1999> but > was:<2008> > > I need that feature for eclipse error parsing and highlighting. > > > Olexiy > -- Kate Ward <kat...@fo...> |