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

Work around recursive_directory_iterator::no_push
Boost 1.85 dropped no_push() with was deprecated after introduction of
disable_recursion_pending() in 1.72 (along with
<boost/filesystem/directory.hpp> header).
Author: xaizek
Author date (UTC): 2024-08-08 13:17
Committer name: xaizek
Committer date (UTC): 2024-08-08 13:40
Parent(s): 43334b95f1f3b56a253639b7501247006cf8a415
Signing key: 99DC5E4DB05F6BE2
Tree: 67fc748a98006b9ca1925630a7ead7051a0d22d0
File Lines added Lines deleted
src/GcovImporter.cpp 31 3
File src/GcovImporter.cpp changed (mode: 100644) (index cc903ca..0fae288)
34 34 #include <stdexcept> #include <stdexcept>
35 35 #include <string> #include <string>
36 36 #include <tuple> #include <tuple>
37 #include <type_traits>
37 38 #include <unordered_set> #include <unordered_set>
38 39 #include <utility> #include <utility>
39 40 #include <vector> #include <vector>
 
... ... namespace {
111 112 //! Files of this bin. //! Files of this bin.
112 113 std::vector<std::string> paths; std::vector<std::string> paths;
113 114 }; };
115
116 //
117 // Work around Boost renaming no_push() to disable_recursion_pending() and
118 // eventually dropping the former by providing a wrapper that prefers the
119 // latter.
120 //
121
122 template <typename T>
123 constexpr decltype(std::declval<T>().disable_recursion_pending(), bool())
124 useNoPush(int)
125 { return false; }
126
127 template <typename T>
128 constexpr bool useNoPush(long)
129 { return true; }
130
131 template <typename DT = fs::recursive_directory_iterator>
132 typename std::enable_if<useNoPush<DT>(0)>::type stop_recursion(DT &it)
133 {
134 it.no_push();
135 }
136
137 template <typename DT = fs::recursive_directory_iterator>
138 typename std::enable_if<!useNoPush<DT>(0)>::type stop_recursion(DT &it)
139 {
140 it.disable_recursion_pending();
141 }
114 142 } }
115 143
116 144 GcovInfo::GcovInfo() GcovInfo::GcovInfo()
 
... ... GcovImporter::GcovImporter(const std::string &root,
195 223 fs::path path = it->path(); fs::path path = it->path();
196 224 if (fs::is_directory(path)) { if (fs::is_directory(path)) {
197 225 if (skipDirs.count(path.filename().string())) { if (skipDirs.count(path.filename().string())) {
198 it.no_push();
226 stop_recursion(it);
199 227 continue; continue;
200 228 } }
201 229 } else if (fs::is_regular_file(path)) { } else if (fs::is_regular_file(path)) {
 
... ... GcovImporter::GcovImporter(const std::string &root,
214 242 fs::path path = it->path(); fs::path path = it->path();
215 243 if (fs::is_directory(path)) { if (fs::is_directory(path)) {
216 244 if (skipDirs.count(path.filename().string())) { if (skipDirs.count(path.filename().string())) {
217 it.no_push();
245 stop_recursion(it);
218 246 } else if (skipPaths.count(normalizePath(fs::absolute(path)))) { } else if (skipPaths.count(normalizePath(fs::absolute(path)))) {
219 it.no_push();
247 stop_recursion(it);
220 248 } }
221 249 } else if (extensions.count(path.extension().string())) { } else if (extensions.count(path.extension().string())) {
222 250 std::string filePath = makeRelativePath(rootDir, path).string(); std::string filePath = makeRelativePath(rootDir, path).string();
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