Database Connector for C++
The cppdbc allows any C++ application to interact with databases.
Use CMake to build and install the cppdbc.
- CMake 3.13+
The first step is configure the project using CMake.
cmake -B build .
After the project has been configured, the next step is to build the library.
cmake --build build
After the library has been build, the last step is to install it.
cmake --build build --target install
The project is shipped with two groups of tests: unit and integration tests.
- Google Test
- Google Mock
To run the unit and integration tests, the tests must be enabled during the configuration. of the project.
cmake -B build -D CPPDBC_TESTS=YES .
After the tests has been built, run them calling this command:
cmake --build build --target test
After the tests have been run, the test reports are generated by default in the path build/test-results.
The test results paths can be changed during the configuration of the project.
cmake -B build -D TEST_REPORT_PATH=<path> .
The name of the test reports can also be changed.
cmake -B build -D UNIT_TEST_REPORT_FILE=<file> -D INTEGRATION_TEST_REPORT_FILE=<file> .
To build the test coverage report, the test coverage has to be enabled during the configuration of the project.
cmake -B build -D CPPDBC_COVERAGE=YES .
Once the test coverage has been enabled, and the unit test has been run, the test coverage report can be built.
cmake --build build --target cppdbc_coverage
The test coverage report is generated under the test results path (by default build/test-results).
The project uses static analysis to prevent bugs and improve the code quality.
- cppcheck
Run the static analysis tool, whenever you would like to check the code.
cmake --build build --target cppdbc_static
The project has all classes and functions documented to help the users to understand them.
To build the documentation, the documentation has to be enabled during the configuration of project.
cmake -B build -D CPPDBC_DOC=YES .
Once the documentation is enabled, it can be built.
cmake --build build --target cppdbc_doc
Pull requests are welcome.
For major changes, please open an issue first to discuss what you would like to change. Please make sure to update tests as appropriate.