Online
Offline see sql_table_design if you can't access the online version.Note that this document may be late than online version.
All source files are in src
directory, each module has its own sub-directory in src
cd ${VINCENT_ROOT_PATH}
mkdir build && cd build
cmake ..
make
or make && make test
if you want to excute testssrc
directorydoxygen docs
call cmake with cmake -DBUILD_DOC=OFF ..
<type>(<scope>): <subject>
# blank line
<body>
# blank line
<footer>
fix(app): avoid memory leak
use smart pointer to avoid memory leak
#2310
The first line cannot be longer than 70 characters, the second line is always blank and other lines should be wrapped at 80 characters. The type and scope should always be lowercase as shown below.
Generally <scope>
value should be the module name, such as app
Briefly concludes modifications
issue or feature number
commit.template
git config --global commit.template ./.gitcommitstyle.txt
every library should has a executable to do test, test excutable name should end with library name plus _test
take proto
for example, its test executable is proto_test
,when built you can run test with
cd build
bin/proto_test
and it should give something like
[doctest] doctest version is "2.3.2"
[doctest] run with "--help" for options
===============================================================================
[doctest] test cases: 1 | 1 passed | 0 failed | 0 skipped
[doctest] assertions: 4 | 4 passed | 0 failed |
[doctest] Status: SUCCESS!
make && make test
Running tests...
/usr/bin/ctest --force-new-ctest-process
Test project /home/thy/Documents/vincent/build
Start 1: proto
1/4 Test #1: proto ............................ Passed 0.00 sec
Start 2: log
2/4 Test #2: log .............................. Passed 0.01 sec
Start 3: config
3/4 Test #3: config ........................... Passed 0.00 sec
Start 4: common
4/4 Test #4: common ........................... Passed 0.01 sec
100% tests passed, 0 tests failed out of 4
Total Test time (real) = 0.03 sec
src
_test
add_subdirectory(module_name)
in src/CMakeLists.tst
following is a CMakeLists
template, in most cases you only need do two things:
config
with your lib_name
common
here to your libfile(GLOB LIB_SRC
"*.cpp"
"*.h")
file(GLOB TEST_SRC
"*test.cpp")
list(REMOVE_ITEM LIB_SRC ${TEST_SRC}})
# add library, replace all `config` with your own `lib_name`
add_library(config ${LIB_SRC})
# add any external lib to your own lib if needed, here is `common`
target_link_libraries(config common)
# add test executable
add_executable(config_test ${TEST_SRC})
add_test(config ${EXECUTABLE_OUTPUT_PATH}/config_test)
# link to lib
target_link_libraries(config_test config)