guix_mirror_bot pushed a commit to branch master
in repository guix.

commit ef4ba3191f013a92e400b24e3e02deb99da3a618
Author: Tomas Volf <[email protected]>
AuthorDate: Sun Jul 14 22:45:16 2024 +0200

    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 <[email protected]>
---
 build-aux/test-driver.scm | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/build-aux/test-driver.scm b/build-aux/test-driver.scm
index 20bd8f095e..6eb3a863f6 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 <[email protected]>
 ;;; Copyright © 2021 Maxim Cournoyer <[email protected]>
@@ -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~%"

Reply via email to