ThrowTheSwitch / Unity

Simple Unit Testing for C
ThrowTheSwitch.org
MIT License
4.02k stars 969 forks source link

Parse test execution time in unity fixture output #659

Open fy666 opened 1 year ago

fy666 commented 1 year ago

When using unity fixture with time output flag set, parse_output.rb did not parse the execution time.

fy666 commented 1 year ago

Hello @mvandervoord,

I'm very sorry to bother you but I was wondering if I did something wrong or I missed some steps for submitting this PR (as I got no reaction) ?

Best regards,

Letme commented 1 year ago

Why is this printout only for passed and not for other cases (failed)?

Letme commented 1 year ago

in line 212 failed case also has time, so I am a bit puzzled why this also does not have it (as well as ignored).

fy666 commented 1 year ago

in line 212 failed case also has time, so I am a bit puzzled why this also does not have it (as well as ignored).

I updated the PR to parse time for fail and ignore cases (for consistency)

However, please note that in unity fixture, the execution time is only printed for passing tests: https://github.com/ThrowTheSwitch/Unity/blob/master/extras/fixture/src/unity_fixture.c#LL298C13-L298C34 I can update that as well if you want

Letme commented 1 year ago

However, please note that in unity fixture, the execution time is only printed for passing tests: I can update that as well if you want

This I can't decide, but I like uniform behavior among features. Strange that other outputs had time in as well - so maybe that is inconsistency which we need to fix. Either have execution time on passing testcases only, or on all (but everywhere the same).

fy666 commented 1 year ago

However, please note that in unity fixture, the execution time is only printed for passing tests: I can update that as well if you want

This I can't decide, but I like uniform behavior among features. Strange that other outputs had time in as well - so maybe that is inconsistency which we need to fix. Either have execution time on passing testcases only, or on all (but everywhere the same).

Sorry for the delay. I just added a commit to make unity fixture output the execution time for failed and ignored tests as well.