GCC Code Coverage Report


Directory: ./
File: main.cpp
Date: 2025-09-27 21:24:05+00:00
Coverage Exec Excl Total
Lines: 96.0% 24 0 25
Functions: 100.0% 4 0 4
Branches: 75.0% 3 0 4

Line Branch Exec Source
1 #include <iostream>
2
3 1 void foo() {
4 1 std::cout << "Hello from foo()." << std::endl;
5 1 }
6
7 template<typename T>
8 4 void func(T a, T b) {
9
3/4
void func<double>(double, double):
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
void func<int>(int, int):
✓ Branch 0 taken 1 time.
✓ Branch 1 taken 1 time.
4 if (a < b) {
10 1 std::cout << a << " is less than " << b << std::endl;
11 }
12 4 }
13
14 #define TO_STR(x) #x
15
16 #define FUNCTION_NAME func_a
17 #include "function.hpp"
18 #undef FUNCTION_NAME
19
20 #define FUNCTION_NAME func_b
21 #include "function.hpp"
22 #undef FUNCTION_NAME
23
24 1 int main(int argc, char* argv[]) {
25 1 foo();
26
27 1 func_a(0, 0);
28 1 func_a(-1, 0);
29 1 func_a(1, 0);
30 1 func_a(0, 11);
31 1 ns::func_a(0);
32
33 1 func_b(0, 0);
34 1 ns::func_b(1);
35
36 1 func<>(0, 0);
37 1 func<>(0, 1);
38
39 1 func<>(0.0, 0.0);
40 1 func<>(0.0, -1.0);
41
42 1 return 0;
43 }
44