de67675842
Projects using cmocka could have done this successfully from version 1.0 to 1.1.5 to build against cmocka: ``` find_package(cmocka 1.0 REQUIRED CONFIG) ``` and later ``` target_link_libraries(myapp ${CMOCKA_LIBRARIES} ) ``` Modern apps should just "link" against 'cmocka::cmocka' instead like it's done in examples already. To not break old builds (as it is the case with cmocka release 1.1.7) we can put that modern target string into the variable CMOCKA_LIBRARIES and thus trick old projects to just use that, keeping compatibility until those projects explicitly use the modern version. Link: https://cmake.org/cmake/help/latest/command/install.html#install-export Link: https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html#package-configuration-file Link: https://cmake.org/cmake/help/latest/module/CMakePackageConfigHelpers.html#module:CMakePackageConfigHelpers Fixes: #87 Signed-off-by: Alexander Dahl <ada@thorsis.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org> |
||
---|---|---|
cmake | ||
coverity | ||
doc | ||
example | ||
include | ||
src | ||
tests | ||
.clang-format | ||
.clang_complete | ||
.editorconfig | ||
.gitignore | ||
.gitlab-ci.yml | ||
.ycm_extra_conf.py | ||
AUTHORS | ||
CMakeLists.txt | ||
COPYING | ||
CPackConfig.cmake | ||
CTestConfig.cmake | ||
ChangeLog | ||
CompilerChecks.cmake | ||
ConfigureChecks.cmake | ||
DefineOptions.cmake | ||
INSTALL.md | ||
NEWS | ||
README.md | ||
cmocka-build-tree-settings.cmake.in | ||
cmocka-config.cmake.in | ||
cmocka.pc.cmake | ||
config.h.cmake | ||
meson.build | ||
meson_options.txt |
README.md
cmocka
cmocka is an elegant unit testing framework for C with support for mock objects. It only requires the standard C library, works on a range of computing platforms (including embedded) and with different compilers.
For information about how to use the cmocka unit testing framework see doc/index.html or https://api.cmocka.org/.
Compiling
To compile the cmocka library and example applications run, create a build dir, and in the build dir call 'cmake /path/to/cmocka' followed by 'make'. On Windows you can use the cmake gui. More details can be found in the INSTALL.md file.