From ec7da7d6289eac9d4aa69be8c0666605725d2333 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Tue, 6 Oct 2020 01:02:53 +0200 Subject: gnu: vlang: Run mosts tests. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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(-) (limited to 'gnu/packages/vlang.scm') 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 @@ (define-public vlang (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 @@ (define-public vlang (("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 @@ (define-public vlang (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 -- cgit v1.2.3