Skip to content

Commit 2b09b5d

Browse files
committed
refactor: move headertest into separate test folder
1 parent 25bc84f commit 2b09b5d

File tree

5 files changed

+18
-17
lines changed

5 files changed

+18
-17
lines changed

tests/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# The main libgit2 tests tree: this CMakeLists.txt includes the
22
# subprojects that make up core libgit2 support.
33

4+
add_subdirectory(headertest)
45
add_subdirectory(libgit2)

tests/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ These are the unit and integration tests for the libgit2 projects.
44

55
* `clar`
66
This is [clar](https://github.com/clar-test/clar) the common test framework.
7+
* `headertest`
8+
This is a simple project that ensures that our public headers are
9+
compatible with extremely strict compilation options.
710
* `libgit2`
811
These tests exercise the core git functionality in libgit2 itself.
912
* `resources`

tests/headertest/CMakeLists.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Header file validation project: ensure that we do not publish any sloppy
2+
# definitions in our headers and that a consumer can include <git2.dll>
3+
# even when they have aggressive C90 warnings enabled.
4+
5+
add_executable(headertest headertest.c)
6+
set_target_properties(headertest PROPERTIES C_STANDARD 90)
7+
set_target_properties(headertest PROPERTIES C_EXTENSIONS OFF)
8+
target_include_directories(headertest PRIVATE ${LIBGIT2_INCLUDES})
9+
10+
if (MSVC)
11+
target_compile_options(headertest PUBLIC /W4 /WX)
12+
else()
13+
target_compile_options(headertest PUBLIC -Wall -Wextra -pedantic -Werror)
14+
endif()

tests/libgit2/CMakeLists.txt

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -80,20 +80,3 @@ add_clar_test(ssh -v -sonline::push -sonline::clone::ssh_cert -s
8080
add_clar_test(proxy -v -sonline::clone::proxy)
8181
add_clar_test(auth_clone -v -sonline::clone::cred)
8282
add_clar_test(auth_clone_and_push -v -sonline::clone::push -sonline::push)
83-
84-
#
85-
# Header file validation project: ensure that we do not publish any sloppy
86-
# definitions in our headers and that a consumer can include <git2.dll>
87-
# even when they have aggressive C90 warnings enabled.
88-
#
89-
90-
add_executable(headertest headertest.c)
91-
set_target_properties(headertest PROPERTIES C_STANDARD 90)
92-
set_target_properties(headertest PROPERTIES C_EXTENSIONS OFF)
93-
target_include_directories(headertest PRIVATE ${LIBGIT2_INCLUDES})
94-
95-
if (MSVC)
96-
target_compile_options(headertest PUBLIC /W4 /WX)
97-
else()
98-
target_compile_options(headertest PUBLIC -Wall -Wextra -pedantic -Werror)
99-
endif()

0 commit comments

Comments
 (0)