catchorg / Catch2

A modern, C++-native, test framework for unit-tests, TDD and BDD - using C++14, C++17 and later (C++11 support is in v2.x branch, and C++03 on the Catch1.x branch)
https://discord.gg/4CWS9zD
Boost Software License 1.0
18.6k stars 3.05k forks source link

Print relative paths instead of absolute path #2295

Open nandanvasudevan opened 3 years ago

nandanvasudevan commented 3 years ago

Description The console output for catch2 is really messy with absolute paths. An option to get the path printed as relative path would be amazing!

Additional context Current output

/home/nandanv/code/sources/.../test/src/sensors/test_temperatureSensor.cpp:99

I suggest

test/src/sensors/test_temperatureSensor.cpp:99

The user may specify what portion of the path should be truncated if required. I think doxygen does something similar.

aminya commented 2 years ago

I agree with this. It makes the console output more readable.

nandanvasudevan commented 2 years ago

I can give it a shot if someone would guide me on where or how to begin.