@@ -142,6 +142,9 @@ and internal API/coding conventions we use.
142142Building libgit2 - Using CMake
143143==============================
144144
145+ Building
146+ --------
147+
145148` libgit2 ` builds cleanly on most platforms without any external dependencies.
146149Under Unix-like systems, like Linux, \* BSD and Mac OS X, libgit2 expects ` pthreads ` to be available;
147150they 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
158161Alternatively 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+
160166Once 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+
168188To 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+
173196For more advanced use or questions about CMake please read < https://cmake.org/Wiki/CMake_FAQ > .
174197
175198The following CMake variables are declared:
0 commit comments