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

Alan-Jowett / ebpf-verifier / 18658728485

18 Oct 2025 05:56PM UTC coverage: 88.47% (+0.4%) from 88.11%
18658728485

push

github

elazarg
Bump external/bpf_conformance from `8f3c2fe` to `6fa6a20`

Bumps [external/bpf_conformance](https://github.com/Alan-Jowett/bpf_conformance) from `8f3c2fe` to `6fa6a20`.
- [Release notes](https://github.com/Alan-Jowett/bpf_conformance/releases)
- [Commits](https://github.com/Alan-Jowett/bpf_conformance/compare/8f3c2fe88...<a class=hub.com/Alan-Jowett/ebpf-verifier/commit/6fa6a20ac6fd3612ea9338312a67408687b9f06b">6fa6a20ac)

---
updated-dependencies:
- dependency-name: external/bpf_conformance
  dependency-version: 6fa6a20ac6fd3612ea9338312a67408687b9f06b
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

8954 of 10121 relevant lines covered (88.47%)

18293099.16 hits per line

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

97.87
/src/test/test_print.cpp
1
// Copyright (c) Prevail Verifier contributors.
2
// SPDX-License-Identifier: MIT
3
#include <catch2/catch_all.hpp>
4

5
#include <algorithm>
6
#include <cctype>
7
#include <string>
8
#include <variant>
9

10
#if !defined(MAX_PATH)
11
#define MAX_PATH (256)
12
#endif
13

14
#include "asm_files.hpp"
15
#include "asm_unmarshal.hpp"
16

17
#define TEST_OBJECT_FILE_DIRECTORY "ebpf-samples/build/"
18
#define TEST_ASM_FILE_DIRECTORY "ebpf-samples/asm/"
19
#define PRINT_CASE(file) \
20
    TEST_CASE("Print suite: " file, "[print]") { verify_printed_string(file); }
21

22
using namespace prevail;
23

24
static void trim_right(std::string& s) {
1,396✔
25
    if (!s.empty() && s.back() == '\r') {
1,396✔
26
        s.pop_back();
×
27
    }
28
    s.erase(std::find_if(s.rbegin(), s.rend(), [](const unsigned char ch) { return !std::isspace(ch); }).base(),
2,792✔
29
            s.end());
1,396✔
30
}
1,396✔
31

32
void verify_printed_string(const std::string& file) {
38✔
33
    std::stringstream generated_output;
38✔
34
    auto raw_progs = read_elf(std::string(TEST_OBJECT_FILE_DIRECTORY) + file + ".o", "", {}, &g_ebpf_platform_linux);
152✔
35
    const RawProgram& raw_prog = raw_progs.back();
38✔
36
    std::variant<InstructionSeq, std::string> prog_or_error = unmarshal(raw_prog);
38✔
37
    auto program = std::get_if<InstructionSeq>(&prog_or_error);
38✔
38
    REQUIRE(program != nullptr);
38✔
39
    print(*program, generated_output, {});
38✔
40
    print_map_descriptors(raw_prog.info.map_descriptors, generated_output);
38✔
41
    std::ifstream expected_stream(std::string(TEST_ASM_FILE_DIRECTORY) + file + std::string(".asm"));
114✔
42
    REQUIRE(expected_stream);
38✔
43
    std::string expected_line;
38✔
44
    std::string actual_line;
38✔
45
    while (std::getline(expected_stream, expected_line)) {
736✔
46
        bool has_more = static_cast<bool>(std::getline(generated_output, actual_line));
698✔
47
        REQUIRE(has_more);
698✔
48
        trim_right(expected_line);
698✔
49
        trim_right(actual_line);
698✔
50
        REQUIRE(expected_line == actual_line);
1,047✔
51
    }
52
    bool has_more = static_cast<bool>(std::getline(expected_stream, actual_line));
38✔
53
    REQUIRE_FALSE(has_more);
57✔
54
}
38✔
55

56
PRINT_CASE("byteswap")
5✔
57
PRINT_CASE("ctxoffset")
5✔
58
PRINT_CASE("exposeptr")
5✔
59
PRINT_CASE("exposeptr2")
5✔
60
PRINT_CASE("map_in_map")
5✔
61
PRINT_CASE("mapoverflow")
5✔
62
PRINT_CASE("mapunderflow")
5✔
63
PRINT_CASE("mapvalue-overrun")
5✔
64
PRINT_CASE("nullmapref")
5✔
65
PRINT_CASE("packet_access")
5✔
66
PRINT_CASE("packet_overflow")
5✔
67
PRINT_CASE("packet_reallocate")
5✔
68
PRINT_CASE("packet_start_ok")
5✔
69
PRINT_CASE("stackok")
5✔
70
PRINT_CASE("tail_call")
5✔
71
PRINT_CASE("tail_call_bad")
5✔
72
PRINT_CASE("twomaps")
5✔
73
PRINT_CASE("twostackvars")
5✔
74
PRINT_CASE("twotypes")
5✔
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