guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

07/08: gnu: vlang: Run mosts tests.


From: guix-commits
Subject: 07/08: gnu: vlang: Run mosts tests.
Date: Mon, 5 Oct 2020 19:06:51 -0400 (EDT)

nckx pushed a commit to branch master
in repository guix.

commit ec7da7d6289eac9d4aa69be8c0666605725d2333
Author: Tobias Geerinckx-Rice <me@tobias.gr>
AuthorDate: Tue Oct 6 01:02:53 2020 +0200

    gnu: vlang: Run mosts tests.
    
    * gnu/packages/vlang.scm (vlang)[arguments]: Enable tests and add a new
    ‘delete-failing-tests’ and custom ‘check’ phase.
    [native-inputs]: Add libx11, node, openssl, and sqlite.
---
 gnu/packages/vlang.scm | 47 +++++++++++++++++++++++++++++++++--------------
 1 file changed, 33 insertions(+), 14 deletions(-)

diff --git a/gnu/packages/vlang.scm b/gnu/packages/vlang.scm
index 42dd27a..6f6aa79 100644
--- a/gnu/packages/vlang.scm
+++ b/gnu/packages/vlang.scm
@@ -19,6 +19,10 @@
 
 (define-module (gnu packages vlang)
   #:use-module (gnu packages glib)
+  #:use-module (gnu packages node)
+  #:use-module (gnu packages sqlite)
+  #:use-module (gnu packages tls)
+  #:use-module (gnu packages xorg)
   #:use-module (guix build-system gnu)
   #:use-module (guix git-download)
   #:use-module ((guix licenses) #:prefix license:)
@@ -39,8 +43,7 @@
       (base32 "1rqi7cah5nq8aggrib9xvdpfjxq20li91svv0w9yny6nn1ag7snx"))))
    (build-system gnu-build-system)
    (arguments
-    '(#:tests? #f                      ; some tests are broken
-      #:make-flags
+    '(#:make-flags
       `("CC=gcc"
         "TMPTCC=tcc"
         ,(string-append "VC=" (assoc-ref %build-inputs "vc"))
@@ -58,17 +61,27 @@
               (("rm -rf") "true")
               (("v self") "v -cc gcc cmd/v"))
             #t))
-        ;; A few tests are broken in v 0.1.27. This function should be
-        ;; enabled to run tests in the next release.
-        ;; (replace 'check
-        ;;   (lambda _
-        ;;     (let* ((tmpbin "tmp/bin")
-        ;;            (gcc (which "gcc")))
-        ;;       (mkdir-p tmpbin)
-        ;;       (symlink gcc (string-append tmpbin "/cc"))
-        ;;       (setenv "PATH" (string-append tmpbin ":" (getenv "PATH")))
-        ;;       (invoke "./v" "test-fixed"))
-        ;;     #t))
+        (add-before 'check 'delete-failing-tests
+          ;; XXX As always, these should eventually be fixed and run.
+          (lambda _
+            (for-each delete-file
+                      '("vlib/v/gen/x64/tests/x64_test.v"
+                        "vlib/v/tests/repl/repl_test.v"
+                        "vlib/v/tests/valgrind/valgrind_test.v"
+                        "vlib/v/tests/valgrind/strings_and_arrays.vv"
+                        "vlib/v/tests/live_test.v"
+                        "vlib/net/websocket/ws_test.v"))
+            #t))
+        (replace 'check
+          (lambda* (#:key tests? #:allow-other-keys)
+            (let* ((bin "tmp/bin")
+                   (gcc (which "gcc")))
+              (when tests?
+                (mkdir-p bin)
+                (symlink gcc (string-append bin "/cc"))
+                (setenv "PATH" (string-append bin ":" (getenv "PATH")))
+                (invoke "./v" "test-fixed")))
+            #t))
         (replace 'install
           (lambda _
             (let* ((bin (string-append (assoc-ref %outputs "out") "/bin"))
@@ -106,7 +119,13 @@
                   (commit vc-version)))
             (file-name (git-file-name "vc" vc-version))
             (sha256
-             (base32 
"052gp5q2k31r3lci3rx4k0vy0vjdjva64xvrbbihn8lgmw63lc9f")))))))
+             (base32 
"052gp5q2k31r3lci3rx4k0vy0vjdjva64xvrbbihn8lgmw63lc9f")))))
+
+      ;; For the tests.
+      ("libx11" ,libx11)
+      ("node" ,node)
+      ("openssl" ,openssl)
+      ("sqlite" ,sqlite)))
    (home-page "https://vlang.io/";)
    (synopsis "Compiler for the V programming language")
    (description



reply via email to

[Prev in Thread] Current Thread [Next in Thread]