summary refs log tree commit diff
path: root/gnu/packages/vlang.scm
diff options
context:
space:
mode:
authorTobias Geerinckx-Rice <me@tobias.gr>2020-10-06 01:02:53 +0200
committerTobias Geerinckx-Rice <me@tobias.gr>2020-10-06 01:04:47 +0200
commitec7da7d6289eac9d4aa69be8c0666605725d2333 (patch)
tree36bb10217124f5f2da5f294fb4b5f2e712c1da35 /gnu/packages/vlang.scm
parent84fa2ced47e16de66674ca169845a6f08cb5ef6c (diff)
downloadguix-ec7da7d6289eac9d4aa69be8c0666605725d2333.tar.gz
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.
Diffstat (limited to 'gnu/packages/vlang.scm')
-rw-r--r--gnu/packages/vlang.scm47
1 files changed, 33 insertions, 14 deletions
diff --git a/gnu/packages/vlang.scm b/gnu/packages/vlang.scm
index 42dd27a915..6f6aa79ce5 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