GCC Code Coverage Report


Directory: ./
File: src/iguana/services/Tools.cc
Date: 2025-12-23 16:10:08
Coverage Exec Excl Total
Lines: 40.0% 2 0 5
Functions: 100.0% 1 0 1
Branches: 27.8% 5 0 18

Line Branch Exec Source
1 #include "Tools.h"
2 #include <stdexcept>
3
4 namespace iguana::tools {
5
6
2/2
✓ Branch 2 → 3 taken 94 times.
✓ Branch 2 → 6 taken 25 times.
119 std::string ExpandTilde(std::string const& path)
7 {
8
3/4
✓ Branch 2 → 3 taken 94 times.
✓ Branch 2 → 6 taken 25 times.
✓ Branch 5 → 6 taken 94 times.
✗ Branch 5 → 7 not taken.
213 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