banditcpp / bandit

Human-friendly unit testing for C++11
https://banditcpp.github.io/bandit/
Other
259 stars 37 forks source link

Make Qt Creator formatter (POSIX formatter with file://) #141

Closed MartinDelille closed 5 years ago

MartinDelille commented 5 years ago

Adding the file:// prefix before a file name allows to enable hyperlink on the Qt Creator output log which make very convenient to find failing test.

What do you think of this feature? Would it be annoying for people not using Qt Creator?

sbeyer commented 5 years ago

Tests are currently failing, but I guess that is intended because you are basically asking if this a useful change. To this question: I think, it might be interesting to have a failure formatter for Qt Creator then. The whole point of failure formatters is to make life easier for the used platform.

Is it correct behavior that for relative filenames, we have file://filename, and for absolute filenames, we have file:///home/foo/filename (three slashes in Unix) or file://C:\foo\filename (just weird in Windows)?

codecov-io commented 5 years ago

Codecov Report

Merging #141 into master will increase coverage by 0.01%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #141      +/-   ##
==========================================
+ Coverage   98.64%   98.65%   +0.01%     
==========================================
  Files          34       35       +1     
  Lines         956      969      +13     
==========================================
+ Hits          943      956      +13     
  Misses         13       13
Impacted Files Coverage Δ
bandit/failure_formatters/qt_creator.h 100% <100%> (ø)
bandit/runner.h 90.78% <100%> (+0.37%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 6c7bd31...2900647. Read the comment docs.

MartinDelille commented 5 years ago

I created a specific qt_creator failure formatter.

Concerning Windows output I wasn't able to test because I don't have Windows machine.

sbeyer commented 5 years ago

I have checked Travis CI and it works for me. So it seems the problems are gone.

I noticed another issue with your PR: In docs/runningtests.md there should be an explanation for the qt choice. See https://github.com/banditcpp/bandit/blob/master/docs/runningtests.md#formatters

MartinDelille commented 5 years ago

I performed the requested change in my last two commits.