guix_mirror_bot pushed a commit to branch master
in repository guix.

commit 366046a775c1950d4004173c43ebf15ef84b1765
Author: Nguyễn Gia Phong <[email protected]>
AuthorDate: Sat Feb 14 22:51:30 2026 +0900

    gnu: python-antlr4-runtime: Enable tests.
    
    * gnu/packages/java.scm (python-antlr4-runtime)[arguments]:
      Enable tests.  <#:phases>: Add regenerate-parsers.
      [native-inputs]: Add antlr4, and remove pkg-config.
      [inputs]: Remove utils-linux:lib.
    
    Change-Id: Id89d0c0bc5ae557f5b4e70fd93159f64bac0ba39
    Signed-off-by: Julien Lepiller <[email protected]>
---
 gnu/packages/java.scm | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index 8e85afe9bb..0885b18297 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -8926,14 +8926,20 @@ generated sources by ANTLR.")))
     (build-system pyproject-build-system)
     (arguments
      (list
-      #:tests? #f                       ; tests require antlr
+      #:test-backend #~'custom
+      #:test-flags #~'("tests/run.py" "--verbose")
       #:phases
       #~(modify-phases %standard-phases
           (add-after 'unpack 'chdir
             (lambda _
-              (chdir "runtime/Python3"))))))
-    (native-inputs (list pkg-config python-setuptools))
-    (inputs (list `(,util-linux "lib"))) ; libuuid
+              (chdir "runtime/Python3")))
+          (add-after 'chdir 'regenerate-parsers
+            (lambda _
+              (invoke "antlr4" "-no-listener" "-Dlanguage=Python3"
+                      "src/antlr4/xpath/XPathLexer.g4")
+              (invoke "antlr4" "-no-listener" "-Dlanguage=Python3"
+                      "tests/expr/Expr.g4"))))))
+    (native-inputs (list antlr4 python-setuptools))
     (synopsis "ANTLR Python runtime library")
     (description "This package contains the Python runtime library used with
 Python generated sources by ANTLR.")))

Reply via email to