III
DevOps
Testing
CI/CD
It allows you to find the areas of a program which is not exercised by a set of test cases, then it allows you to create extra test cases to increase coverage.
*.gcno
from -ftest-coverage
and *.gcda
from -fprofile-arcs
) that can be processed by the gcov command.*.gcno
files are generated after compilation.*.gcda
files are generated after execution.source code 要被編譯成.o
時,要加
GITLAB_GCOV_LDFLAGS += -fprofile-arcs -ftest-coverage -O0 -fPIC
.o
要連結成.so
時,要加
GITLAB_GCOV_FLAGS += -fprofile-arcs -O0 -fPIC -shared
列出執行檔相依的動態函式庫
$ ldd unit-test/authTest/authTest.exe
搜索某檔名的路徑
$ find . -name 'libauth.so'
搜索含有某內容的檔案路徑
$ grep -rnw '\-lauth' .
展開 Makefile
$ make -nprR -C ulibs/auth | less
# makefile (from 'Makefile', line 7)
LIB_NAME = libauth.so