guix-commits
[Top][All Lists]
Advanced

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

05/11: build-system: android-ndk: Support unit tests.


From: Danny Milosavljevic
Subject: 05/11: build-system: android-ndk: Support unit tests.
Date: Wed, 9 May 2018 19:06:52 -0400 (EDT)

dannym pushed a commit to branch master
in repository guix.

commit 9ed36cd3d6a4146f5f314b79a6fd6ada93d03164
Author: Danny Milosavljevic <address@hidden>
Date:   Thu May 10 00:05:58 2018 +0200

    build-system: android-ndk: Support unit tests.
    
    * guix/build-system/android-ndk.scm (android-ndk-build): Add googletest.
    * guix/build/android-ndk-build-system.scm (check): Check whether tests are
    enabled.  Run root-level tests as well.
---
 guix/build-system/android-ndk.scm       |  1 +
 guix/build/android-ndk-build-system.scm | 14 +++++++++-----
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/guix/build-system/android-ndk.scm 
b/guix/build-system/android-ndk.scm
index 842d983..891fc6e 100644
--- a/guix/build-system/android-ndk.scm
+++ b/guix/build-system/android-ndk.scm
@@ -113,6 +113,7 @@
                         ;; Keep the standard inputs of 'gnu-build-system'
                         ,@(standard-packages)))
          (build-inputs `(("android-make-stub" ,(module-ref (resolve-interface 
'(gnu packages android)) 'android-make-stub))
+                         ("googletest" ,(module-ref (resolve-interface '(gnu 
packages check)) 'googletest))
                          ,@native-inputs))
          (outputs outputs)
          (build android-ndk-build)
diff --git a/guix/build/android-ndk-build-system.scm 
b/guix/build/android-ndk-build-system.scm
index b5d4b36..86d0858 100644
--- a/guix/build/android-ndk-build-system.scm
+++ b/guix/build/android-ndk-build-system.scm
@@ -68,11 +68,15 @@
         (copy-recursively "include" (string-append out "/include")))
     #t))
 
-(define* (check #:key inputs outputs tests? (make-flags '()) 
#:allow-other-keys)
-  ;; TODO: Also handle root-level tests.
-  (when (and (file-exists? "tests") tests?)
-    (with-directory-excursion "tests"
-      (apply invoke "make" "check" make-flags))))
+(define* (check #:key target inputs outputs (tests? (not target)) (make-flags 
'()) #:allow-other-keys)
+  (if tests?
+      (begin
+        (apply invoke "make" "check" make-flags)
+        (when (and (file-exists? "tests") tests?)
+          (with-directory-excursion "tests"
+            (apply invoke "make" "check" make-flags))))
+      (format #t "test suite not run~%"))
+  #t)
 
 (define %standard-phases
   (modify-phases gnu:%standard-phases



reply via email to

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