]> git.ipfire.org Git - thirdparty/git.git/commit
cmake: use test names instead of full paths
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Mon, 25 Sep 2023 11:20:35 +0000 (11:20 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 9 Nov 2023 23:16:27 +0000 (08:16 +0900)
commit2f2729f3a4626838fce294a0cec4e525c5f4be39
tree1c03da945b62fffc44cc72826d12006b751cf189
parent5bd7fb49afbe315c08102fea3536823068fad46d
cmake: use test names instead of full paths

The primary purpose of Git's CMake definition is to allow developing Git
in Visual Studio. As part of that, the CTest feature allows running
individual test scripts conveniently in Visual Studio's Test Explorer.

However, this Test Explorer's design targets object-oriented languages
and therefore expects the test names in the form
`<namespace>.<class>.<testname>`. And since we specify the full path
of the test scripts instead, including the ugly `/.././t/` part, these
dots confuse the Test Explorer and it uses a large part of the path as
"namespace".

Let's just use `t.suite.<name>` instead. This presents the tests in
Visual Studio's Test Explorer in the following form by default (i.e.
unless the user changes the view via the "Group by" menu):

◢ ◈ git
 ◢ ◈ t
  ◢ ◈ suite
     ◈ t0000-basic
     ◈ t0001-init
     ◈ t0002-gitfile
     [...]

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/buildsystems/CMakeLists.txt