mirror of
https://codeberg.org/guix/guix.git
synced 2026-01-25 03:55:08 -06:00
build: renpy: Add check command.
* guix/build/renpy-build-system.scm (start-xorg-server, check): New variables. (%standard-phases): Adjust accordingly. * guix/build-system/renpy.scm (renpy-build): Support #:tests? and #:test-flags.
This commit is contained in:
parent
a6c83120f2
commit
712d0c27f8
2 changed files with 20 additions and 2 deletions
|
|
@ -81,6 +81,8 @@
|
|||
(outputs '("out"))
|
||||
(output "out")
|
||||
(game "game")
|
||||
(tests? #t)
|
||||
(test-flags ''())
|
||||
(search-paths '())
|
||||
(system (%current-system))
|
||||
(guile #f)
|
||||
|
|
@ -102,6 +104,8 @@
|
|||
#:outputs #$(outputs->gexp outputs)
|
||||
#:output #$output
|
||||
#:game #$game
|
||||
#:test-flags #$test-flags
|
||||
#:tests? #$tests?
|
||||
#:search-paths
|
||||
'#$(sexp->gexp
|
||||
(map search-path-specification->sexp
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2021 Liliana Marie Prikler <liliana.prikler@gmail.com>
|
||||
;;; Copyright © 2021, 2025 Liliana Marie Prikler <liliana.prikler@gmail.com>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
|
|
@ -39,6 +39,19 @@
|
|||
;; badly if we do
|
||||
"quit"))
|
||||
|
||||
(define* (start-xorg-server #:key tests? inputs native-inputs #:allow-other-keys)
|
||||
(when tests?
|
||||
(let ((Xvfb (search-input-file (or native-inputs inputs)
|
||||
"/bin/Xvfb")))
|
||||
(setenv "HOME" (getcwd))
|
||||
(system (format #f "~a :1 &" Xvfb))
|
||||
(setenv "DISPLAY" ":1"))))
|
||||
|
||||
(define* (check #:key game tests? (test-flags '()) #:allow-other-keys)
|
||||
(if tests?
|
||||
(apply invoke "renpy" game "test" test-flags)
|
||||
(display "test suite not run\n")))
|
||||
|
||||
(define* (install #:key inputs outputs game (output "out") #:allow-other-keys)
|
||||
(let* ((out (assoc-ref outputs output))
|
||||
(json-dump (call-with-input-file (string-append game
|
||||
|
|
@ -87,7 +100,8 @@
|
|||
(delete 'bootstrap)
|
||||
(delete 'configure)
|
||||
(replace 'build build)
|
||||
(delete 'check)
|
||||
(add-before 'check 'start-xorg-server start-xorg-server)
|
||||
(replace 'check check)
|
||||
(replace 'install install)
|
||||
(add-after 'install 'install-desktop-file install-desktop-file)))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue