guix-commits
[Top][All Lists]
Advanced

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

01/06: gnu: rust: Enable more tests.


From: Danny Milosavljevic
Subject: 01/06: gnu: rust: Enable more tests.
Date: Mon, 16 Apr 2018 13:59:51 -0400 (EDT)

dannym pushed a commit to branch master
in repository guix.

commit 1bb23335e63522a558594adf4ab30003eb141e31
Author: Nikolai Merinov <address@hidden>
Date:   Sun Apr 15 10:05:14 2018 +0200

    gnu: rust: Enable more tests.
    
    * gnu/packages/rust.scm (rust-1.19)[arguments]<#:phases>[set-env]: Modify.
    (rust-1.23)<#:phases>[patch-cargo-tests]: New phase.
    (rust-1.23)<#:phases>[check]: Enable more tests.
---
 gnu/packages/rust.scm | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
index eaa8c48..1112d08 100644
--- a/gnu/packages/rust.scm
+++ b/gnu/packages/rust.scm
@@ -161,9 +161,12 @@ in turn be used to build the final Rust.")
        #:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'set-env
-           (lambda _
+           (lambda* (#:key inputs #:allow-other-keys)
+             ;; Disable test for cross compilation support.
+             (setenv "CFG_DISABLE_CROSS_TESTS" "1")
              (setenv "SHELL" (which "sh"))
              (setenv "CONFIG_SHELL" (which "sh"))
+             (setenv "CC" (string-append (assoc-ref inputs "gcc") "/bin/gcc"))
              ;; guix llvm-3.9.1 package installs only shared libraries
              (setenv "LLVM_LINK_SHARED" "1")
              #t))
@@ -258,7 +261,17 @@ safety and thread safety guarantees.")
      (substitute-keyword-arguments (package-arguments rust-1.19)
        ((#:phases phases)
         `(modify-phases ,phases
-           (add-after 'patch-tests 'fix-mtime-bug
+           (add-after 'patch-tests 'patch-cargo-tests
+             (lambda _
+               (substitute* "src/tools/cargo/tests/build.rs"
+                (("/usr/bin/env") (which "env"))
+                ;; Guix llvm is compiled without asmjs-unknown-emscripten.
+                (("fn wasm32_final_outputs") "#[ignore]\nfn 
wasm32_final_outputs"))
+               (substitute* "src/tools/cargo/tests/death.rs"
+                ;; This is stuck when built in container.
+                (("fn ctrl_c_kills_everyone") "#[ignore]\nfn 
ctrl_c_kills_everyone"))
+               #t))
+           (add-after 'patch-cargo-tests 'fix-mtime-bug
              (lambda* _
                (substitute* "src/build_helper/lib.rs"
                  ;; Bug in Rust code.
@@ -327,7 +340,8 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\"
              (invoke "./x.py" "build" "src/tools/cargo")))
          (replace 'check
            (lambda* _
-             (invoke "./x.py" "test")))
+             (invoke "./x.py" "test")
+             (invoke "./x.py" "test" "src/tools/cargo")))
          (replace 'install
            (lambda* (#:key outputs #:allow-other-keys)
              (invoke "./x.py" "install")



reply via email to

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