Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
a89db0e7
Unverified
Commit
a89db0e7
authored
Oct 17, 2021
by
Edward Thomson
Committed by
GitHub
Oct 17, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6083 from libgit2/ethomson/clar_no_more
parents
e61abdce
4e14d4c6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
18 additions
and
18 deletions
+18
-18
CMakeLists.txt
+3
-3
README.md
+1
-1
docs/fuzzing.md
+1
-1
fuzzers/corpora/objects/blob
+1
-1
tests/CMakeLists.txt
+10
-10
tests/README.md
+2
-2
No files found.
CMakeLists.txt
View file @
a89db0e7
...
@@ -38,7 +38,7 @@ INCLUDE(EnableWarnings)
...
@@ -38,7 +38,7 @@ INCLUDE(EnableWarnings)
OPTION
(
SONAME
"Set the (SO)VERSION of the target"
ON
)
OPTION
(
SONAME
"Set the (SO)VERSION of the target"
ON
)
OPTION
(
BUILD_SHARED_LIBS
"Build Shared Library (OFF for Static)"
ON
)
OPTION
(
BUILD_SHARED_LIBS
"Build Shared Library (OFF for Static)"
ON
)
OPTION
(
THREADSAFE
"Build libgit2 as threadsafe"
ON
)
OPTION
(
THREADSAFE
"Build libgit2 as threadsafe"
ON
)
OPTION
(
BUILD_
CLAR
"Build Tests using the Clar suite"
ON
)
OPTION
(
BUILD_
TESTS
"Build Tests using the Clar suite"
ON
)
OPTION
(
BUILD_EXAMPLES
"Build library usage example apps"
OFF
)
OPTION
(
BUILD_EXAMPLES
"Build library usage example apps"
OFF
)
OPTION
(
BUILD_FUZZERS
"Build the fuzz targets"
OFF
)
OPTION
(
BUILD_FUZZERS
"Build the fuzz targets"
OFF
)
OPTION
(
ENABLE_TRACE
"Enables tracing support"
ON
)
OPTION
(
ENABLE_TRACE
"Enables tracing support"
ON
)
...
@@ -281,7 +281,7 @@ IF (NOT MSVC)
...
@@ -281,7 +281,7 @@ IF (NOT MSVC)
ENDIF
()
ENDIF
()
ENDIF
()
ENDIF
()
IF
(
BUILD_
CLAR
)
IF
(
BUILD_
TESTS
)
ENABLE_TESTING
()
ENABLE_TESTING
()
ADD_SUBDIRECTORY
(
tests
)
ADD_SUBDIRECTORY
(
tests
)
ENDIF
()
ENDIF
()
...
@@ -295,7 +295,7 @@ IF(BUILD_FUZZERS)
...
@@ -295,7 +295,7 @@ IF(BUILD_FUZZERS)
IF
(
BUILD_EXAMPLES
)
IF
(
BUILD_EXAMPLES
)
MESSAGE
(
FATAL_ERROR
"Cannot build the fuzzer targets and the examples together"
)
MESSAGE
(
FATAL_ERROR
"Cannot build the fuzzer targets and the examples together"
)
ENDIF
()
ENDIF
()
IF
(
BUILD_
CLAR
)
IF
(
BUILD_
TESTS
)
MESSAGE
(
FATAL_ERROR
"Cannot build the fuzzer targets and the tests together"
)
MESSAGE
(
FATAL_ERROR
"Cannot build the fuzzer targets and the tests together"
)
ENDIF
()
ENDIF
()
ENDIF
()
ENDIF
()
...
...
README.md
View file @
a89db0e7
...
@@ -278,7 +278,7 @@ The following CMake variables are declared:
...
@@ -278,7 +278,7 @@ The following CMake variables are declared:
-
`CMAKE_INSTALL_LIBDIR`
: Where to install libraries to.
-
`CMAKE_INSTALL_LIBDIR`
: Where to install libraries to.
-
`CMAKE_INSTALL_INCLUDEDIR`
: Where to install headers to.
-
`CMAKE_INSTALL_INCLUDEDIR`
: Where to install headers to.
-
`BUILD_SHARED_LIBS`
: Build libgit2 as a Shared Library (defaults to ON)
-
`BUILD_SHARED_LIBS`
: Build libgit2 as a Shared Library (defaults to ON)
-
`BUILD_
CLAR`
: Build
[
Clar
](
https://github.com/vmg/clar
)
-based test suite
(defaults to ON)
-
`BUILD_
TESTS`
: Build the unit and integration test suites
(defaults to ON)
-
`THREADSAFE`
: Build libgit2 with threading support (defaults to ON)
-
`THREADSAFE`
: Build libgit2 with threading support (defaults to ON)
To list all build options and their current value, you can do the
To list all build options and their current value, you can do the
...
...
docs/fuzzing.md
View file @
a89db0e7
...
@@ -19,7 +19,7 @@ automated fuzz testing. libFuzzer only works with clang.
...
@@ -19,7 +19,7 @@ automated fuzz testing. libFuzzer only works with clang.
and
[
`leak`/`address,leak`
](
https://clang.llvm.org/docs/LeakSanitizer.html
)
.
and
[
`leak`/`address,leak`
](
https://clang.llvm.org/docs/LeakSanitizer.html
)
.
3.
Create the cmake build environment and configure the build with the
3.
Create the cmake build environment and configure the build with the
sanitizer chosen:
`CC=/usr/bin/clang-6.0 CFLAGS="-fsanitize=address" cmake
sanitizer chosen:
`CC=/usr/bin/clang-6.0 CFLAGS="-fsanitize=address" cmake
-DBUILD_
CLAR
=OFF -DBUILD_FUZZERS=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo ..`
.
-DBUILD_
TESTS
=OFF -DBUILD_FUZZERS=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo ..`
.
Note that building the fuzzer targets is incompatible with the
Note that building the fuzzer targets is incompatible with the
tests and examples.
tests and examples.
4.
Build libgit2:
`cmake --build .`
4.
Build libgit2:
`cmake --build .`
...
...
fuzzers/corpora/objects/blob
View file @
a89db0e7
...
@@ -229,7 +229,7 @@ The following CMake variables are declared:
...
@@ -229,7 +229,7 @@ The following CMake variables are declared:
- `LIB_INSTALL_DIR`: Where to install libraries to.
- `LIB_INSTALL_DIR`: Where to install libraries to.
- `INCLUDE_INSTALL_DIR`: Where to install headers to.
- `INCLUDE_INSTALL_DIR`: Where to install headers to.
- `BUILD_SHARED_LIBS`: Build libgit2 as a Shared Library (defaults to ON)
- `BUILD_SHARED_LIBS`: Build libgit2 as a Shared Library (defaults to ON)
- `BUILD_
CLAR
`: Build [Clar](https://github.com/vmg/clar)-based test suite (defaults to ON)
- `BUILD_
TESTS
`: Build [Clar](https://github.com/vmg/clar)-based test suite (defaults to ON)
- `THREADSAFE`: Build libgit2 with threading support (defaults to ON)
- `THREADSAFE`: Build libgit2 with threading support (defaults to ON)
- `STDCALL`: Build libgit2 as `stdcall`. Turn off for `cdecl` (Windows; defaults to ON)
- `STDCALL`: Build libgit2 as `stdcall`. Turn off for `cdecl` (Windows; defaults to ON)
...
...
tests/CMakeLists.txt
View file @
a89db0e7
...
@@ -3,7 +3,7 @@ FIND_PACKAGE(PythonInterp)
...
@@ -3,7 +3,7 @@ FIND_PACKAGE(PythonInterp)
IF
(
NOT PYTHONINTERP_FOUND
)
IF
(
NOT PYTHONINTERP_FOUND
)
MESSAGE
(
FATAL_ERROR
"Could not find a python interpeter, which is needed to build the tests. "
MESSAGE
(
FATAL_ERROR
"Could not find a python interpeter, which is needed to build the tests. "
"Make sure python is available, or pass -DBUILD_
CLAR
=OFF to skip building the tests"
)
"Make sure python is available, or pass -DBUILD_
TESTS
=OFF to skip building the tests"
)
ENDIF
()
ENDIF
()
SET
(
CLAR_FIXTURES
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/resources/"
)
SET
(
CLAR_FIXTURES
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/resources/"
)
...
@@ -39,26 +39,26 @@ SET_SOURCE_FILES_PROPERTIES(
...
@@ -39,26 +39,26 @@ SET_SOURCE_FILES_PROPERTIES(
INCLUDE_DIRECTORIES(
${
LIBGIT2_INCLUDES
}
)
INCLUDE_DIRECTORIES(
${
LIBGIT2_INCLUDES
}
)
INCLUDE_DIRECTORIES(SYSTEM
${
LIBGIT2_SYSTEM_INCLUDES
}
)
INCLUDE_DIRECTORIES(SYSTEM
${
LIBGIT2_SYSTEM_INCLUDES
}
)
ADD_EXECUTABLE(libgit2_
clar
${
SRC_CLAR
}
${
SRC_TEST
}
${
LIBGIT2_OBJECTS
}
)
ADD_EXECUTABLE(libgit2_
tests
${
SRC_CLAR
}
${
SRC_TEST
}
${
LIBGIT2_OBJECTS
}
)
SET_TARGET_PROPERTIES(libgit2_
clar
PROPERTIES C_STANDARD 90)
SET_TARGET_PROPERTIES(libgit2_
tests
PROPERTIES C_STANDARD 90)
SET_TARGET_PROPERTIES(libgit2_
clar
PROPERTIES RUNTIME_OUTPUT_DIRECTORY
${
libgit2_BINARY_DIR
}
)
SET_TARGET_PROPERTIES(libgit2_
tests
PROPERTIES RUNTIME_OUTPUT_DIRECTORY
${
libgit2_BINARY_DIR
}
)
TARGET_INCLUDE_DIRECTORIES(libgit2_
clar
PRIVATE ../src PUBLIC ../include)
TARGET_INCLUDE_DIRECTORIES(libgit2_
tests
PRIVATE ../src PUBLIC ../include)
TARGET_LINK_LIBRARIES(libgit2_
clar
${
LIBGIT2_LIBS
}
)
TARGET_LINK_LIBRARIES(libgit2_
tests
${
LIBGIT2_LIBS
}
)
IDE_SPLIT_SOURCES(libgit2_
clar
)
IDE_SPLIT_SOURCES(libgit2_
tests
)
IF (MSVC_IDE)
IF (MSVC_IDE)
# Precompiled headers
# Precompiled headers
SET_TARGET_PROPERTIES(libgit2_
clar
PROPERTIES COMPILE_FLAGS "
/Yuprecompiled.h /FIprecompiled.h
")
SET_TARGET_PROPERTIES(libgit2_
tests
PROPERTIES COMPILE_FLAGS "
/Yuprecompiled.h /FIprecompiled.h
")
SET_SOURCE_FILES_PROPERTIES("
precompiled.c
" COMPILE_FLAGS "
/Ycprecompiled.h
")
SET_SOURCE_FILES_PROPERTIES("
precompiled.c
" COMPILE_FLAGS "
/Ycprecompiled.h
")
ENDIF ()
ENDIF ()
FUNCTION(ADD_CLAR_TEST name)
FUNCTION(ADD_CLAR_TEST name)
IF (NOT USE_LEAK_CHECKER STREQUAL "
OFF
")
IF (NOT USE_LEAK_CHECKER STREQUAL "
OFF
")
ADD_TEST(
${
name
}
"
${
libgit2_SOURCE_DIR
}
/script/
${
USE_LEAK_CHECKER
}
.sh
" "
${
libgit2_BINARY_DIR
}
/libgit2_
clar
"
${
ARGN
}
)
ADD_TEST(
${
name
}
"
${
libgit2_SOURCE_DIR
}
/script/
${
USE_LEAK_CHECKER
}
.sh
" "
${
libgit2_BINARY_DIR
}
/libgit2_
tests
"
${
ARGN
}
)
ELSE()
ELSE()
ADD_TEST(
${
name
}
"
${
libgit2_BINARY_DIR
}
/libgit2_
clar
"
${
ARGN
}
)
ADD_TEST(
${
name
}
"
${
libgit2_BINARY_DIR
}
/libgit2_
tests
"
${
ARGN
}
)
ENDIF()
ENDIF()
ENDFUNCTION(ADD_CLAR_TEST)
ENDFUNCTION(ADD_CLAR_TEST)
...
...
tests/README.md
View file @
a89db0e7
...
@@ -11,7 +11,7 @@ https://github.com/vmg/clar
...
@@ -11,7 +11,7 @@ https://github.com/vmg/clar
*
Make sure you actually build the tests by setting:
*
Make sure you actually build the tests by setting:
cmake -DBUILD_
CLAR
=ON build/
cmake -DBUILD_
TESTS
=ON build/
*
Test:
*
Test:
...
@@ -32,7 +32,7 @@ These are automatically run as part of CI, but if you want to check locally:
...
@@ -32,7 +32,7 @@ These are automatically run as part of CI, but if you want to check locally:
Uses
[
`valgrind`
](
http://www.valgrind.org/
)
:
Uses
[
`valgrind`
](
http://www.valgrind.org/
)
:
```
console
```
console
$
cmake
-DBUILD_
CLAR
=
ON
-DVALGRIND
=
ON ..
$
cmake
-DBUILD_
TESTS
=
ON
-DVALGRIND
=
ON ..
$
cmake
--build
.
$
cmake
--build
.
$
valgrind
--leak-check
=
full
--show-reachable
=
yes
--num-callers
=
50
--suppressions
=
../libgit2_clar.supp
\
$
valgrind
--leak-check
=
full
--show-reachable
=
yes
--num-callers
=
50
--suppressions
=
../libgit2_clar.supp
\
./libgit2_clar
./libgit2_clar
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment