Skip to content

Commit c5d8682

Browse files
committed
README: clarify why one would run libgit2_clar
Since we recommend `ctest -V`, it's not clear why somebody would want to run `libgit2_clar`. Indicate that it's helpful when running individual tests or suites.
1 parent 9e91a98 commit c5d8682

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ and internal API/coding conventions we use.
142142
Building libgit2 - Using CMake
143143
==============================
144144

145+
Building
146+
--------
147+
145148
`libgit2` builds cleanly on most platforms without any external dependencies.
146149
Under Unix-like systems, like Linux, \*BSD and Mac OS X, libgit2 expects `pthreads` to be available;
147150
they should be installed by default on all systems. Under Windows, libgit2 uses the native Windows API
@@ -157,6 +160,9 @@ On most systems you can build the library using the following commands
157160

158161
Alternatively you can point the CMake GUI tool to the CMakeLists.txt file and generate platform specific build project or IDE workspace.
159162

163+
Running Tests
164+
-------------
165+
160166
Once built, you can run the tests from the `build` directory with the command
161167

162168
$ ctest -V
@@ -165,11 +171,28 @@ Alternatively you can run the test suite directly using,
165171

166172
$ ./libgit2_clar
167173

174+
Invoking the test suite directly is useful because it allows you to execute
175+
individual tests, or groups of tests using the `-s` flag. For example, to
176+
run the index tests:
177+
178+
$ ./libgit2_clar -sindex
179+
180+
To run a single test named `index::racy::diff`, which corresponds to the test
181+
function (`test_index_racy__diff`)[https://github.com/libgit2/libgit2/blob/master/tests/index/racy.c#L23]:
182+
183+
$ ./libgit2_clar -sindex::racy::diff
184+
185+
Installation
186+
------------
187+
168188
To install the library you can specify the install prefix by setting:
169189

170190
$ cmake .. -DCMAKE_INSTALL_PREFIX=/install/prefix
171191
$ cmake --build . --target install
172192

193+
Advanced Usage
194+
--------------
195+
173196
For more advanced use or questions about CMake please read <https://cmake.org/Wiki/CMake_FAQ>.
174197

175198
The following CMake variables are declared:

0 commit comments

Comments
 (0)