summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Volf <~@wolfsden.cz>2024-07-14 22:45:16 +0200
committerMaxim Cournoyer <maxim@guixotic.coop>2026-03-20 17:38:15 +0900
commitef4ba3191f013a92e400b24e3e02deb99da3a618 (patch)
treeea8cbd3c281affa950c7240c556f641c1b829256
parent4b60e86f2e07dbbcdb2970cfe8520d68fb3e2ec0 (diff)
build: test-driver.scm: Refine the global test result.
The :test-global-result: .trs metadata contained just either FAIL, SKIP or PASS with a comment that further refinements are required for XPASS. The description of :test-global-result: is in the manual is as follows: This is used to declare the "global result" of the script. Currently, the value of this field is needed only to be reported (more or less verbatim) in the generated global log file ‘$(TEST_SUITE_LOG)’, so it’s quite free-form. For example, a test script which runs 10 test cases, 6 of which pass and 4 of which are skipped, could reasonably have a ‘PASS/SKIP’ value for this field, while a test script which runs 19 successful tests and one failed test could have an ‘ALMOST PASSED’ value. As we can see, the examples as `PASS/SKIP' and `ALMOST PASSED', so there is no need to stick to strict model. Hence this commit changes the resulting value to be comma-separated list of PASS, FAIL, XPASS, XFAIL and SKIP. The respective elements are present only when the count of tests with such a result is positive. In practice, that should usually produce lines such as :test-global-result: PASS,FAIL or :test-global-result: PASS * build-aux/test-driver.scm (test-runner-gnu)[finalize]: Refine the output of :test-global-result:. Change-Id: I7178ac9703e1749adf6de2445f7ed0591983cef2 Signed-off-by: Maxim Cournoyer <maxim@guixotic.coop>
-rwxr-xr-xbuild-aux/test-driver.scm19
1 files changed, 15 insertions, 4 deletions
diff --git a/build-aux/test-driver.scm b/build-aux/test-driver.scm
index 20bd8f095ed..6eb3a863f6a 100755
--- a/build-aux/test-driver.scm
+++ b/build-aux/test-driver.scm
@@ -3,7 +3,7 @@ exec guile --no-auto-compile -e main -s "$0" "$@"
!#
;;;; test-driver.scm - Guile test driver for Automake testsuite harness
-(define script-version "2026-03-19.14") ;UTC
+(define script-version "2026-03-20.08") ;UTC
;;; Copyright © 2015, 2016 Mathieu Lirzin <mthl@gnu.org>
;;; Copyright © 2021 Maxim Cournoyer <maxim@guixotic.coop>
@@ -191,9 +191,20 @@ called to do the final reporting."
(positive? (test-runner-xpass-count runner))))
(skip (or (positive? (test-runner-skip-count runner))
(positive? (test-runner-xfail-count runner)))))
- ;; XXX: The global results need some refinements for XPASS.
- (format trs-port ":global-test-result: ~A~%"
- (if fail "FAIL" (if skip "SKIP" "PASS")))
+ (format trs-port ":test-global-result: ~{~A~^,~}~%"
+ (filter-map (λ (proc str)
+ (let ((n (proc runner)))
+ (if (positive? n) str #f)))
+ (list test-runner-pass-count
+ test-runner-fail-count
+ test-runner-xpass-count
+ test-runner-xfail-count
+ test-runner-skip-count)
+ (list "PASS"
+ "FAIL"
+ "XPASS"
+ "XFAIL"
+ "SKIP")))
(format trs-port ":recheck: ~A~%"
(if fail "yes" "no"))
(format trs-port ":copy-in-global-log: ~A~%"