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.master
parent
3385db349f
commit
9ed36cd3d6
|
@ -113,6 +113,7 @@
|
||||||
;; Keep the standard inputs of 'gnu-build-system'
|
;; Keep the standard inputs of 'gnu-build-system'
|
||||||
,@(standard-packages)))
|
,@(standard-packages)))
|
||||||
(build-inputs `(("android-make-stub" ,(module-ref (resolve-interface '(gnu packages android)) 'android-make-stub))
|
(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))
|
,@native-inputs))
|
||||||
(outputs outputs)
|
(outputs outputs)
|
||||||
(build android-ndk-build)
|
(build android-ndk-build)
|
||||||
|
|
|
@ -68,11 +68,15 @@
|
||||||
(copy-recursively "include" (string-append out "/include")))
|
(copy-recursively "include" (string-append out "/include")))
|
||||||
#t))
|
#t))
|
||||||
|
|
||||||
(define* (check #:key inputs outputs tests? (make-flags '()) #:allow-other-keys)
|
(define* (check #:key target inputs outputs (tests? (not target)) (make-flags '()) #:allow-other-keys)
|
||||||
;; TODO: Also handle root-level tests.
|
(if tests?
|
||||||
(when (and (file-exists? "tests") tests?)
|
(begin
|
||||||
(with-directory-excursion "tests"
|
(apply invoke "make" "check" make-flags)
|
||||||
(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
|
(define %standard-phases
|
||||||
(modify-phases gnu:%standard-phases
|
(modify-phases gnu:%standard-phases
|
||||||
|
|
Reference in New Issue