gnu: php: Run tests in parallel.

* gnu/packages/php.scm (php) [arguments]
{prepare-tests}: Set TEST_PHP_ARGS environment variable.

Change-Id: Ideed9528c3474ff8c2f0abd760b64f12a7e3ec08
This commit is contained in:
Maxim Cournoyer 2025-09-30 09:39:55 +09:00
parent 32898c0056
commit 6018973ea6
No known key found for this signature in database
GPG key ID: 1260E46482E63562

View file

@ -162,7 +162,7 @@
(("/bin/sh") (("/bin/sh")
(which "sh"))))) (which "sh")))))
(add-before 'check 'prepare-tests (add-before 'check 'prepare-tests
(lambda _ (lambda* (#:key parallel-tests? #:allow-other-keys)
;; Some of these files have ISO-8859-1 encoding, whereas others ;; Some of these files have ISO-8859-1 encoding, whereas others
;; use ASCII, so we can't use a "catch-all" find-files here. ;; use ASCII, so we can't use a "catch-all" find-files here.
(with-fluids ((%default-port-encoding "ISO-8859-1")) (with-fluids ((%default-port-encoding "ISO-8859-1"))
@ -323,7 +323,12 @@
(setenv "REPORT_EXIT_STATUS" "1") (setenv "REPORT_EXIT_STATUS" "1")
;; Skip tests requiring I/O facilities that are unavailable in the ;; Skip tests requiring I/O facilities that are unavailable in the
;; build environment ;; build environment
(setenv "SKIP_IO_CAPTURE_TESTS" "1")))) (setenv "SKIP_IO_CAPTURE_TESTS" "1")
;; Run tests in parallel.
(setenv "TEST_PHP_ARGS"
(format #f "-j~a" (if parallel-tests?
(parallel-job-count)
1))))))
#:test-target "test")) #:test-target "test"))
(inputs (inputs
(list aspell (list aspell