guix_mirror_bot pushed a commit to branch c++-team
in repository guix.
commit b991ee6c1820d6706d1c1acd59c5ee9eb976b769
Author: Greg Hogan <[email protected]>
AuthorDate: Mon Mar 24 16:01:17 2025 +0000
gnu: bpftrace: Fix tests.
* gnu/packages/linux.scm (bpftrace)
[arguments]: Replace #:test-target with #:test-exclude.
<#:phases>: Add 'fix-paths and 'set-test-filter.
[native-inputs]: Add coreutils.
Change-Id: I66e2f616ae6ff2a133eca2d96a1aae15a88d6c93
---
gnu/packages/linux.scm | 29 +++++++++++++++++++++++------
1 file changed, 23 insertions(+), 6 deletions(-)
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 649758dfd7..da94bf80bc 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -11295,11 +11295,8 @@ modification of BPF objects on the system.")
(build-system cmake-build-system)
(arguments
(list
+ #:test-exclude "(runtime_tests|tools-parsing-test)"
#:configure-flags #~(list "-DBUILD_TESTING=ON")
- ;; Only run the unit tests suite, as the other ones
- ;; (runtime_tests, tools-parsing-test) require to run as
- ;; 'root'.
- #:test-target "bpftrace_test"
#:phases
#~(modify-phases %standard-phases
;; This patch also fixes broken compilation due to improper detection
@@ -11321,8 +11318,28 @@ modification of BPF objects on the system.")
"runtime/call"
"procmon.cpp")
(("/bin/ls")
- (which "ls")))))))))
- (native-inputs (list bison dwarves flex googletest xxd))
+ (which "ls"))))))
+ (add-after 'unpack 'fix-paths
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (substitute* '("tests/child.cpp")
+ (("/bin/sleep")
+ (search-input-file inputs "bin/sleep")))))
+ (add-before 'check 'set-test-filter
+ (lambda _
+ (setenv "GTEST_FILTER"
+ (string-join
+ (list ; "-" disables all following tests
+ "-ast.probe_name_uprobe"
+ "bpftrace.add_probes_uprobe_wildcard_file"
+
"bpftrace.add_probes_uprobe_wildcard_file_uprobe_multi"
+ "bpftrace.add_probes_usdt_wildcard"
+ "Parser.multiple_attach_points_kprobe"
+ "Parser.uretprobe_offset"
+ "semantic_analyser.builtin_functions"
+ "semantic_analyser.call_func"
+ "semantic_analyser.call_uaddr")
+ ":")))))))
+ (native-inputs (list bison coreutils dwarves flex googletest xxd))
(inputs (list bcc clang-15 elfutils libbpf libiberty cereal))
(home-page "https://github.com/bpftrace/bpftrace")
(synopsis "High-level tracing language for Linux eBPF")