GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 40.0% 2 / 0 / 5
Functions: 100.0% 1 / 0 / 1
Branches: 27.8% 5 / 0 / 18

src/iguana/services/Tools.cc
Line Branch Exec Source
1 #include "Tools.h"
2 #include <stdexcept>
3
4 namespace iguana::tools {
5
6
2/2
✓ Branch 2 → 3 taken 160 times.
✓ Branch 2 → 6 taken 26 times.
186 std::string ExpandTilde(std::string const& path)
7 {
8
3/4
✓ Branch 2 → 3 taken 160 times.
✓ Branch 2 → 6 taken 26 times.
✓ Branch 5 → 6 taken 160 times.
✗ Branch 5 → 7 not taken.
346 if(path.empty() || path[0] != '~')
9 return path;
10 if(char const* home_dir = std::getenv("HOME"); home_dir)
11 return std::string(home_dir) + path.substr(1);
12 throw std::runtime_error("cannot expand `~` since $HOME is not set");
13 }
14
15 }
16