https://github.com/kurotych/modern-cpp-lib
Investigate ways to create modern cpp project
https://github.com/kurotych/modern-cpp-lib
bindings ci cmake codecov cpp docker gcc gcov gtest html lcov library modern python testing travis unit
Last synced: 4 months ago
JSON representation
Investigate ways to create modern cpp project
- Host: GitHub
- URL: https://github.com/kurotych/modern-cpp-lib
- Owner: kurotych
- License: mit
- Created: 2019-04-30T16:31:53.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-09-22T09:43:50.000Z (over 5 years ago)
- Last Synced: 2024-12-31T16:22:46.243Z (5 months ago)
- Topics: bindings, ci, cmake, codecov, cpp, docker, gcc, gcov, gtest, html, lcov, library, modern, python, testing, travis, unit
- Language: C++
- Homepage:
- Size: 134 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Modern cpp library
## Investigates best way to build modern project for develop UNIX C++ library based on C API for binding any language
[](https://app.codacy.com/app/armatusmiles/modern-cpp-lib?utm_source=github.com&utm_medium=referral&utm_content=armatusmiles/modern-cpp-lib&utm_campaign=Badge_Grade_Dashboard)
[](https://hub.docker.com/r/armatusmiles/moderncpp)
[](https://codecov.io/gh/armatusmiles/modern-cpp-lib)| Build status | Systems / Compilers |
| ------------- | ------------------------------------------ |
| [](https://travis-ci.org/armatusmiles/modern-cpp-lib) | Linux (gcc) OSX (XCode 10.2 clang) |## Features
- Creates shared(*.so, *.dylib) library
- [Google test(gtest)](https://github.com/armatusmiles/modern-cpp-lib/blob/master/tests/main.cpp) simple and powerful test framework
- [Catch2](https://github.com/armatusmiles/modern-cpp-lib/tree/add-catch2/tests-catch2) single header test library
- [Python bindings](https://github.com/armatusmiles/modern-cpp-lib/blob/master/test_api.py) Load library and call C API function from Python.
- [Codecov](https://codecov.io/gh/armatusmiles/modern-cpp-lib) - reports generate automatically
- [Docker](https://github.com/armatusmiles/modern-cpp-lib/blob/master/Dockerfile) file and [auto build](https://hub.docker.com/r/armatusmiles/moderncpp) with [Docker Hub](https://hub.docker.com/r/armatusmiles/moderncpp)
- [Travis-CI](https://travis-ci.org/armatusmiles/moderncpp) auto build for ubuntu xenial and osx
- [Cppcheck](http://cppcheck.sourceforge.net) is a static analysis tool for C/C++ code## Libraries used
- [Google Test (gtest)](https://github.com/google/googletest) - [test](https://github.com/armatusmiles/modern-cpp-lib/blob/master/tests/main.cpp) framework
- [gcov](https://linux.die.net/man/1/gcov) / [lcov](https://linux.die.net/man/1/lcov) - generates and shows in html format code coverage## Build and Run
```
git clone https://github.com/armatusmiles/modern-cpp-lib.git \
&& cd modern-cpp-lib \
&& mkdir build && cd build \
&& cmake ../ \
&& make moderncpp_coverage
```cppcheck simple example
cppcheck ./src/
Checking src/interface.cpp ...
[src/interface.cpp:11]: (error) Array 'a[5]' accessed at index 6, which is out of bounds.###### Notice: For choose catch2 test framework. Should add var -DTEST_TYPE="catch2" Exmaple : cmake ../ -DTEST_TYPE="catch2"
> "make moderncpp_coverage" builds library, runs gtest and generate code coverage(html) report
## References
- [ModernCppCI](https://github.com/LearningByExample/ModernCppCI)
- [cmake-modules](https://github.com/bilke/cmake-modules)
- [Catch2](https://github.com/catchorg/Catch2)
- [cppcheck manual](http://cppcheck.sourceforge.net/manual.pdf)