单测与统计(粗糙的笔记)
CLANG_ENABLE_CODE_COVERAGE = NO;(非必需)
GCC_GENERATE_TEST_COVERAGE_FILES = NO;
GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = NO;
codeCoverageEnabled = "YES">
签名、真机;(test bundle总是加载失败,也许重装就行了)
extern void __gcov_dump(void);
__gcov_dump();
pod里面要有test工程;
生成gcno(Objects-normal/) + gcda(/device),拷贝一起;
gcno:
setenv("GCOV_PREFIX", [docpath], 1);
setenv("GCOV_PREFIX_STRIP", "13", 1);
用lcov来
【参考:https://blog.csdn.net/gease_lcj/article/details/103566120】
-----
lcov --remove Coverage.info '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/*' -o Coverage_fliter.info
lcov -c -d ./Documents/arm64 -b ./ -o ./coverage.info
genhtml -t "report" --rc lcov_branch_coverage=1 coverage.info -o Document
----
全力写单测。。。
---
做链路mock;
【上面每个细节的原理】