• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

llnl / dftracer-utils / 23529483807

25 Mar 2026 07:17AM UTC coverage: 48.515% (-1.6%) from 50.098%
23529483807

Pull #57

github

web-flow
Merge 5b1e117ad into 38f9f3616
Pull Request #57: feat(comparator): add pairwise traces comparator

18829 of 49412 branches covered (38.11%)

Branch coverage included in aggregate %.

1584 of 1933 new or added lines in 14 files covered. (81.95%)

3552 existing lines in 135 files now uncovered.

18474 of 27477 relevant lines covered (67.23%)

241072.53 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

47.3
/src/dftracer/utils/utilities/common/query/ast.cpp
1
#include <dftracer/utils/utilities/common/query/ast.h>
2

3
#include <sstream>
4
#include <string>
5

6
namespace dftracer::utils::utilities::common::query {
7

8
const char* compare_op_str(CompareOp op) {
3✔
9
    switch (op) {
3!
10
        case CompareOp::EQ:
11
            return "==";
2✔
12
        case CompareOp::NE:
13
            return "!=";
×
14
        case CompareOp::GT:
15
            return ">";
1✔
16
        case CompareOp::LT:
17
            return "<";
×
18
        case CompareOp::GE:
19
            return ">=";
×
20
        case CompareOp::LE:
21
            return "<=";
×
22
    }
23
    return "??";
×
24
}
3✔
25

26
namespace {
27

28
void literal_to_string(std::ostringstream& os, const LiteralNode& lit) {
3✔
29
    std::visit(
3✔
30
        [&os](auto&& v) {
6✔
31
            using T = std::decay_t<decltype(v)>;
32
            if constexpr (std::is_same_v<T, std::string>) {
33
                os << '"' << v << '"';
2✔
34
            } else if constexpr (std::is_same_v<T, bool>) {
35
                os << (v ? "true" : "false");
×
36
            } else if constexpr (std::is_same_v<T, int64_t>) {
37
                os << v;
×
38
            } else if constexpr (std::is_same_v<T, uint64_t>) {
39
                os << v;
1✔
40
            } else if constexpr (std::is_same_v<T, double>) {
41
                os << v;
×
42
            }
43
        },
3✔
44
        lit.value);
3✔
45
}
3✔
46

47
void array_to_string(std::ostringstream& os, const ArrayNode& arr) {
×
48
    os << '[';
×
49
    for (std::size_t i = 0; i < arr.elements.size(); ++i) {
×
50
        if (i > 0) os << ", ";
×
51
        literal_to_string(os, arr.elements[i]);
×
UNCOV
52
    }
×
53
    os << ']';
×
54
}
×
55

56
void node_to_string(std::ostringstream& os, const QueryNode& node) {
4✔
57
    std::visit(
4✔
58
        [&os](auto&& n) {
8✔
59
            using T = std::decay_t<decltype(n)>;
60
            if constexpr (std::is_same_v<T, CompareNode>) {
61
                os << n.field.path << ' ' << compare_op_str(n.op) << ' ';
3✔
62
                literal_to_string(os, n.value);
3✔
63
            } else if constexpr (std::is_same_v<T, InNode>) {
64
                os << n.field.path << " in ";
×
65
                array_to_string(os, n.values);
×
66
            } else if constexpr (std::is_same_v<T, NotInNode>) {
67
                os << n.field.path << " not in ";
×
68
                array_to_string(os, n.values);
×
69
            } else if constexpr (std::is_same_v<T, AndNode>) {
70
                os << '(';
1✔
71
                node_to_string(os, *n.left);
1✔
72
                os << " and ";
1✔
73
                node_to_string(os, *n.right);
1✔
74
                os << ')';
1✔
75
            } else if constexpr (std::is_same_v<T, OrNode>) {
76
                os << '(';
×
77
                node_to_string(os, *n.left);
×
78
                os << " or ";
×
79
                node_to_string(os, *n.right);
×
80
                os << ')';
×
81
            } else if constexpr (std::is_same_v<T, NotNode>) {
82
                os << "not (";
×
83
                node_to_string(os, *n.operand);
×
84
                os << ')';
×
85
            }
86
        },
4✔
87
        node.data);
4✔
88
}
4✔
89

90
}  // namespace
91

92
std::string to_string(const QueryNode& node) {
2✔
93
    std::ostringstream os;
2✔
94
    node_to_string(os, node);
2!
95
    return os.str();
2!
96
}
2✔
97

98
}  // namespace dftracer::utils::utilities::common::query
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc