A minimum complete project, support docker, ci, unittest, clang-format, clang-tidy, valgrind.
The goal of this project is to provide a platform for developing and automating real-world scenarios.
This project support multiple compliers and multiple platform, and support clang-format and clang-tidy in the cmake, last, it support ci.
python3 build.py --help
python3 build.py
python build.py --docker-name {dockername}
File will be generated in stage directory.
If you want to use docker, you have to build docker image firstly.
In the docker directory, we provide two dockerfile, it is ubuntu-trusty and alpine respectively.
cd docker/{linux-platform}
sudo docker build -t {mini-complete-linux-platform} .
you also can build and run it like this:
python3 build.py --docker-name {mini-complete-linux-platform}
sudo docker run -it --rm -v "$PWD":"$PWD" -w "$PWD" {mini-complete-linux-platform} stage/{mini-complete-linux-platform}/release/main
If you work on the windows or mac, and you want to cross platform , you don't want to use virtual machine, because it is so heavy. Docker is better choose.
- If you need boost or others library, you don't need to build environment again and again. And others don't need to build it again.
- You can build multiple platform by dockrfile.
- You only need one source code. you can run it use 'docker -v'.
- GCC
- Clang
- MSVC
Support cross-platform, you can easy use it for linux, android, window. More importantly, it supports clang-format, clang-tidy, valgrind and ctest.
make clang-format
make clang-tidy
make valgrind
ctest --output-on-failure
You can integrate clang-tidy and clang-format easily in a CMake-based build-system.
If you install valgrind , you can use "make valgrind" test memory leak.
Cmake support ctest, you can add_test in the CMakeList.txt.
This project use doctest, it just give a simple example.
You should choose to better unit test tool base on your need.
Travis CI This project provode a exmple .travis.yml.
appveyor This project provode a exmple appveyor.yml.
It supports gcc/clang and MSVC. You have to pass all the tests(clang-tidy, build, unittest, test) to be successful.
You can test this project first. Then fork this project, replacing your file with the main.cpp file. Appropriately modify the CMakeList.txt file on it.