1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-06-06 19:36:09 +02:00
git/contrib/buildsystems
Sibi Siddharthan c4b2f41b5f cmake: support for testing git with ctest
This patch provides an alternate way to test git using ctest.
CTest ships with CMake, so there is no additional dependency being
introduced.

To perform the tests with ctest do this after building:
ctest -j[number of jobs]

NOTE: -j is optional, the default number of jobs is 1

Each of the jobs does this:
cd t/ && sh t[something].sh

The reason for using CTest is that it logs the output of the tests
in a neat way, which can be helpful during diagnosis of failures.

After the tests have run ctest generates three log files located in
`build-directory`/Testing/Temporary/

These log files are:

CTestCostData.txt:
This file contains the time taken to complete each test.

LastTestsFailed.log:
This log file contains the names of the tests that have failed in the
run.

LastTest.log:
This log file contains the log of all the tests that have run.
A snippet of the file is given below.

10/901 Testing: D:/my/git-master/t/t0009-prio-queue.sh
10/901 Test: D:/my/git-master/t/t0009-prio-queue.sh
Command: "sh.exe" "D:/my/git-master/t/t0009-prio-queue.sh"
Directory: D:/my/git-master/t
"D:/my/git-master/t/t0009-prio-queue.sh"
Output:
----------------------------------------------------------
ok 1 - basic ordering
ok 2 - mixed put and get
ok 3 - notice empty queue
ok 4 - stack order
passed all 4 test(s)
1..4
<end of output>
Test time =   1.11 sec

NOTE: Testing only works when building in source for now.

Signed-off-by: Sibi Siddharthan <sibisiddharthan.github@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-06-26 10:08:46 -07:00
..
Generators Merge branch 'js/azure-pipelines-msvc' 2019-10-15 13:48:00 +09:00
CMakeLists.txt cmake: support for testing git with ctest 2020-06-26 10:08:46 -07:00
Generators.pm contrib/buildsystems: ignore irrelevant files in Generators/ 2019-07-29 14:51:42 -07:00
engine.pl msvc: accommodate for vcpkg's upgrade to OpenSSL v1.1.x 2020-01-16 12:18:23 -08:00
generate mark Windows build scripts executable 2013-11-25 15:01:22 -08:00
parse.pl mark Windows build scripts executable 2013-11-25 15:01:22 -08:00