~ruther/guix-local

4c0174c4bc9de2d8eea69616b90e48b070feb8a4 — Greg Hogan 1 year, 6 months ago 913c361
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
1 files changed, 23 insertions(+), 6 deletions(-)

M gnu/packages/linux.scm
M gnu/packages/linux.scm => gnu/packages/linux.scm +23 -6
@@ 11299,11 11299,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


@@ 11325,8 11322,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")