guix_mirror_bot pushed a commit to branch master
in repository guix.

commit 61f36109e05b5fbc67e218243baf5a7ee7752fee
Author: Nguyễn Gia Phong <[email protected]>
AuthorDate: Sat Feb 14 22:48:06 2026 +0900

    gnu: cpp-antlr4-runtime: Enable tests.
    
    * gnu/packages/java.scm (cpp-antlr4-runtime)[arguments]: Enable tests.
      <#:phases>: Add unbundle-googletest.
      [native-inputs]: Add googletest.
    
    Change-Id: Ie10ae44c712f12cf7b5babb447a95a8407de41f4
    Signed-off-by: Julien Lepiller <[email protected]>
---
 gnu/packages/java.scm | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index b0809ce07b..efe3c1e70a 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -62,6 +62,7 @@
   #:use-module (gnu packages base)
   #:use-module (gnu packages bash)
   #:use-module (gnu packages nss)
+  #:use-module (gnu packages check)
   #:use-module (gnu packages cpio)
   #:use-module (gnu packages cups)
   #:use-module (gnu packages compression)
@@ -8886,14 +8887,18 @@ sources by ANTLR.")
      (list
       ;; TODO: try to run the tests under
       ;; runtime-testsuite/test/org/antlr/v4/test/runtime/cpp with antlr4.
-      #:tests? #f                       ;no CMake test target
-      ;; TODO: Building the tests wants to download googletest.
-      #:configure-flags #~'("-DANTLR_BUILD_CPP_TESTS=OFF")
       #:phases
       #~(modify-phases %standard-phases
           (add-after 'unpack 'chdir
             (lambda _
               (chdir "runtime/Cpp")))
+          (add-after 'chdir 'unbundle-googletest
+            (lambda _
+              (substitute* "runtime/CMakeLists.txt"
+                (("^  FetchContent_MakeAvailable.*")
+                 "")
+                (("gtest_main" all)
+                 (string-append "gtest " all)))))
           (add-after 'install 'move-static-library
             (lambda* (#:key outputs #:allow-other-keys)
               (let ((static (assoc-ref outputs "static"))
@@ -8904,7 +8909,7 @@ sources by ANTLR.")
                  libantlr4-runtime.a
                  (string-append static "/lib/"
                                 (basename libantlr4-runtime.a)))))))))
-    (native-inputs (list pkg-config))
+    (native-inputs (list googletest pkg-config))
     (inputs (list `(,util-linux "lib"))) ;libuuid
     (synopsis "ANTLR C++ runtime library")
     (description "This package contains the C++ runtime library used with C++

Reply via email to