GCC Code Coverage Report


Directory: src/
File: script_transcompiler/main.cpp
Date: 2024-12-30 15:39:09
Exec Total Coverage
Lines: 18 22 81.8%
Functions: 1 1 100.0%
Branches: 22 44 50.0%

Line Branch Exec Source
1
2 #include <cstdlib>
3
4 #include "transcompiler.h"
5 #include "data.h"
6 #include <iostream>
7
8 8 int main(int argc, char* argv[])
9 {
10 8 data data;
11
12
1/2
✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
8 transcompiler(data, argc, argv);
13
14
2/2
✓ Branch 5 taken 24 times.
✓ Branch 6 taken 8 times.
32 for (const auto& i : data.i)
15 {
16
2/2
✓ Branch 0 taken 4 times.
✓ Branch 1 taken 20 times.
24 if (i.p == issue::phase::PARSING)
17
1/2
✓ Branch 1 taken 4 times.
✗ Branch 2 not taken.
4 std::cout << "Parsing ";
18
1/2
✓ Branch 0 taken 20 times.
✗ Branch 1 not taken.
20 else if (i.p == issue::phase::OPTIMIZAZION)
19
1/2
✓ Branch 1 taken 20 times.
✗ Branch 2 not taken.
20 std::cout << "Optimization ";
20 else if (i.p == issue::phase::CODE_GENERATION)
21 std::cout << "Code Generation ";
22 else
23 std::cout << "Storing Result ";
24
25
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 24 times.
24 if (i.t == issue::type::WARNING)
26 std::cout << "Warning: ";
27
2/2
✓ Branch 0 taken 20 times.
✓ Branch 1 taken 4 times.
24 else if (i.t == issue::type::INFO)
28
1/2
✓ Branch 1 taken 20 times.
✗ Branch 2 not taken.
20 std::cout << "Info: ";
29 else
30
1/2
✓ Branch 1 taken 4 times.
✗ Branch 2 not taken.
4 std::cout << "Error: ";
31
32
2/4
✓ Branch 1 taken 24 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 24 times.
✗ Branch 5 not taken.
24 std::cout << i.msg << std::endl;
33
34 //if (i.number > 0)
35
5/10
✓ Branch 1 taken 24 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 24 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 24 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 24 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 24 times.
✗ Branch 14 not taken.
24 std::cout << "Line " << i.number << ": " << i.line << std::endl;
36 }
37
38
2/2
✓ Branch 0 taken 4 times.
✓ Branch 1 taken 4 times.
8 if (!data.success)
39 4 return EXIT_FAILURE;
40
41 4 return EXIT_SUCCESS;
42 8 }
43