xaizek / uncov (License: AGPLv3+) (since 2018-12-07)
Uncov(er) is a tool that collects and processes code coverage reports.
Commit ee3f22f1d32b55d56231e40c2f5b7393facc31e7

Allow faking GcovInfo to facilitate testing
Author: xaizek
Author date (UTC): 2021-06-06 16:36
Committer name: xaizek
Committer date (UTC): 2021-06-06 16:36
Parent(s): 752833ae90e21d98096e051e1379c7634ae1f130
Signing key: 99DC5E4DB05F6BE2
Tree: 87585bbdc89eee15426fd53a7ea21a46e10f8314
File Lines added Lines deleted
src/GcovImporter.cpp 9 2
src/GcovImporter.hpp 13 1
File src/GcovImporter.cpp changed (mode: 100644) (index d0f4907..005da6d)
... ... GcovInfo::GcovInfo()
138 138 } }
139 139 } }
140 140
141 GcovInfo::GcovInfo(bool employBinning, bool jsonFormat,
142 bool intermediateFormat)
143 : employBinning(employBinning), jsonFormat(jsonFormat),
144 intermediateFormat(intermediateFormat)
145 { }
146
141 147 std::function<GcovImporter::runner_f> std::function<GcovImporter::runner_f>
142 148 GcovImporter::setRunner(std::function<runner_f> runner) GcovImporter::setRunner(std::function<runner_f> runner)
143 149 { {
 
... ... GcovImporter::setRunner(std::function<runner_f> runner)
149 155 GcovImporter::GcovImporter(const std::string &root, GcovImporter::GcovImporter(const std::string &root,
150 156 const std::string &covoutRoot, const std::string &covoutRoot,
151 157 const std::vector<std::string> &exclude, const std::vector<std::string> &exclude,
152 const std::string &prefix)
153 : rootDir(normalizePath(fs::absolute(root))),
158 const std::string &prefix,
159 GcovInfo gcovInfo)
160 : gcovInfo(gcovInfo), rootDir(normalizePath(fs::absolute(root))),
154 161 prefix(prefix) prefix(prefix)
155 162 { {
156 163 for (const std::string &p : exclude) { for (const std::string &p : exclude) {
File src/GcovImporter.hpp changed (mode: 100644) (index 1df01ff..7991260)
33 33 class GcovInfo class GcovInfo
34 34 { {
35 35 public: public:
36 /**
37 * @brief Determines information about `gcov`.
38 */
36 39 GcovInfo(); GcovInfo();
40 /**
41 * @brief Initializes data with predefined values.
42 *
43 * @param employBinning No calling `gcov` with identically named files.
44 * @param jsonFormat If JSON format is available.
45 * @param intermediateFormat If plain text format is available.
46 */
47 GcovInfo(bool employBinning, bool jsonFormat, bool intermediateFormat);
37 48
38 49 public: public:
39 50 /** /**
 
... ... public:
98 109 * @param covoutRoot Root of subtree containing coverage data. * @param covoutRoot Root of subtree containing coverage data.
99 110 * @param exclude List of paths to exclude. * @param exclude List of paths to exclude.
100 111 * @param prefix Prefix to be added to relative path of sources. * @param prefix Prefix to be added to relative path of sources.
112 * @param gcovInfo Information about `gcov` command.
101 113 */ */
102 114 GcovImporter(const std::string &root, const std::string &covoutRoot, GcovImporter(const std::string &root, const std::string &covoutRoot,
103 115 const std::vector<std::string> &exclude, const std::vector<std::string> &exclude,
104 const std::string &prefix);
116 const std::string &prefix, GcovInfo gcovInfo = {});
105 117
106 118 public: public:
107 119 /** /**
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/uncov

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/uncov

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master