-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
asserts: Implemented new composable assertion API.
This proposal implements assertions as composable sub-functions for the `cr_assert` and `cr_expect` macros. For instance, instead of having `cr_assert_eq(1, 2)`, the user can either use `cr_assert(eq(1, 2))` or `cr_assert(eq(i32, 1, 2))`. This has the advantage of simplifying the implementation of the assert macro, but also brings to the table an improved correctness by letting the user enforce the type of operands with a type tag, and the possibility to pretty-print and natively compare user types without c11 or compiler-specific constructs like _Generic or __builtin_types_compatible_p. This also lets us handle properly special comparison cases like ulp-based equality for IEEE floats. Fixes #165, #182.
- Loading branch information
Showing
73 changed files
with
5,523 additions
and
739 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,33 @@ | |||
# - Try to find the libgit2 library | |||
# Once done this will define | |||
# | |||
# LIBGIT2_FOUND - System has libgit2 | |||
# LIBGIT2_INCLUDE_DIR - The libgit2 include directory | |||
# LIBGIT2_LIBRARIES - The libraries needed to use libgit2 | |||
# LIBGIT2_DEFINITIONS - Compiler switches required for using libgit2 | |||
|
|||
|
|||
# use pkg-config to get the directories and then use these values | |||
# in the FIND_PATH() and FIND_LIBRARY() calls | |||
#FIND_PACKAGE(PkgConfig) | |||
#PKG_SEARCH_MODULE(PC_LIBGIT2 libgit2) | |||
|
|||
SET(LIBGIT2_DEFINITIONS ${PC_LIBGIT2_CFLAGS_OTHER}) | |||
|
|||
FIND_PATH(LIBGIT2_INCLUDE_DIR NAMES git2.h | |||
HINTS | |||
${PC_LIBGIT2_INCLUDEDIR} | |||
${PC_LIBGIT2_INCLUDE_DIRS} | |||
) | |||
|
|||
FIND_LIBRARY(LIBGIT2_LIBRARIES NAMES git2 | |||
HINTS | |||
${PC_LIBGIT2_LIBDIR} | |||
${PC_LIBGIT2_LIBRARY_DIRS} | |||
) | |||
|
|||
|
|||
INCLUDE(FindPackageHandleStandardArgs) | |||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(libgit2 DEFAULT_MSG LIBGIT2_LIBRARIES LIBGIT2_INCLUDE_DIR) | |||
|
|||
MARK_AS_ADVANCED(LIBGIT2_INCLUDE_DIR LIBGIT2_LIBRARIES) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.