(backtrace))
(kill-emacs 2))))
+(defvar ert-load-file-name nil
+ "The name of the loaded ERT test file, a string.
+Usually, it is not needed to be defined, but if different ERT
+test packages depend on each other, it might be helpful.")
+
(defun ert-write-junit-test-report (stats)
"Write a JUnit test report, generated from STATS."
;; https://www.ibm.com/docs/en/developer-for-zos/14.1.0?topic=formats-junit-xml-format
;; https://llg.cubic.org/docs/junit/
(when-let ((symbol (car (apropos-internal "" #'ert-test-boundp)))
(test-file (symbol-file symbol 'ert--test))
- (test-report (file-name-with-extension test-file "xml")))
+ (test-report
+ (file-name-with-extension
+ (or ert-load-file-name test-file) "xml")))
(with-temp-file test-report
(insert "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n")
(insert (format "<testsuites name=\"%s\" tests=\"%s\" errors=\"%s\" failures=\"%s\" skipped=\"%s\" time=\"%s\">\n"
(ert--stats-end-time stats)
(ert--stats-start-time stats)))
(ert--format-time-iso8601 (ert--stats-end-time stats))))
- (insert " <properties>\n"
- (format " <property name=\"selector\" value=\"%s\"/>\n"
- (ert--stats-selector stats))
- " </properties>\n")
+ ;; If the test has aborted, `ert--stats-selector' might return
+ ;; huge junk. Skip this.
+ (when (< (length (format "%s" (ert--stats-selector stats))) 1024)
+ (insert " <properties>\n"
+ (format " <property name=\"selector\" value=\"%s\"/>\n"
+ (xml-escape-string
+ (format "%s" (ert--stats-selector stats)) 'noerror))
+ " </properties>\n"))
(cl-loop for test across (ert--stats-tests stats)
for result = (ert-test-most-recent-result test) do
(insert (format " <testcase name=\"%s\" status=\"%s\" time=\"%s\""
(xml-escape-string
- (symbol-name (ert-test-name test)))
+ (symbol-name (ert-test-name test)) 'noerror)
(ert-string-for-test-result
result
(ert-test-result-expected-p test result))
(insert (format " <skipped message=\"%s\" type=\"%s\">\n"
(xml-escape-string
(string-trim
- (ert-reason-for-test-result result)))
+ (ert-reason-for-test-result result))
+ 'noerror)
(ert-string-for-test-result
result
(ert-test-result-expected-p
test result)))
(xml-escape-string
(string-trim
- (ert-reason-for-test-result result)))
+ (ert-reason-for-test-result result))
+ 'noerror)
"\n"
" </skipped>\n"))
((ert-test-aborted-with-non-local-exit-p result)
test result)))
(format "Test %s aborted with non-local exit\n"
(xml-escape-string
- (symbol-name (ert-test-name test))))
+ (symbol-name (ert-test-name test)) 'noerror))
" </error>\n"))
((not (ert-test-result-type-p
result (ert-test-expected-result-type test)))
(insert (format " <failure message=\"%s\" type=\"%s\">\n"
(xml-escape-string
(string-trim
- (ert-reason-for-test-result result)))
+ (ert-reason-for-test-result result))
+ 'noerror)
(ert-string-for-test-result
result
(ert-test-result-expected-p
test result)))
(xml-escape-string
(string-trim
- (ert-reason-for-test-result result)))
+ (ert-reason-for-test-result result))
+ 'noerror)
"\n"
" </failure>\n")))
(unless (zerop (length (ert-test-result-messages result)))
(insert " <system-out>\n"
(xml-escape-string
- (ert-test-result-messages result))
+ (ert-test-result-messages result) 'noerror)
" </system-out>\n"))
(insert " </testcase>\n")))
(insert " </testsuite>\n")
(insert (format " <error message=\"Test report missing %s\" type=\"error\">\n"
(file-name-nondirectory test-report)))
(when logfile-contents
- (insert (xml-escape-string logfile-contents)))
+ (insert (xml-escape-string logfile-contents 'noerror)))
(insert " </error>\n"
" </testcase>\n"
" </testsuite>\n")
- test/lib-src/*resources/**
variables:
target: emacs-inotify
- make_params: "-C test check-lib-src"
+ make_params: "-k -C test check-lib-src"
test-lisp-inotify:
stage: normal
- test/lisp/*resources/**
variables:
target: emacs-inotify
- make_params: "-C test check-lisp"
+ make_params: "-k -C test check-lisp"
test-lisp-calc-inotify:
stage: normal
- test/lisp/calc/*resources/**
variables:
target: emacs-inotify
- make_params: "-C test check-lisp-calc"
+ make_params: "-k -C test check-lisp-calc"
test-lisp-calendar-inotify:
stage: normal
- test/lisp/calendar/*resources/**
variables:
target: emacs-inotify
- make_params: "-C test check-lisp-calendar"
+ make_params: "-k -C test check-lisp-calendar"
test-lisp-cedet-inotify:
stage: normal
- test/lisp/cedet/*resources/**
variables:
target: emacs-inotify
- make_params: "-C test check-lisp-cedet"
+ make_params: "-k -C test check-lisp-cedet"
test-lisp-cedet-semantic-inotify:
stage: normal
- test/lisp/cedet/semantic/*resources/**
variables:
target: emacs-inotify
- make_params: "-C test check-lisp-cedet-semantic"
+ make_params: "-k -C test check-lisp-cedet-semantic"
test-lisp-cedet-semantic-bovine-inotify:
stage: normal
- test/lisp/cedet/semantic/bovine/*resources/**
variables:
target: emacs-inotify
- make_params: "-C test check-lisp-cedet-semantic-bovine"
+ make_params: "-k -C test check-lisp-cedet-semantic-bovine"
test-lisp-cedet-srecode-inotify:
stage: normal
- test/lisp/cedet/srecode/*resources/**
variables:
target: emacs-inotify
- make_params: "-C test check-lisp-cedet-srecode"
+ make_params: "-k -C test check-lisp-cedet-srecode"
test-lisp-emacs-lisp-inotify:
stage: normal
- test/lisp/emacs-lisp/*resources/**
variables:
target: emacs-inotify
- make_params: "-C test check-lisp-emacs-lisp"
+ make_params: "-k -C test check-lisp-emacs-lisp"
test-lisp-emacs-lisp-eieio-tests-inotify:
stage: normal
- test/lisp/emacs-lisp/eieio-tests/*resources/**
variables:
target: emacs-inotify
- make_params: "-C test check-lisp-emacs-lisp-eieio-tests"
+ make_params: "-k -C test check-lisp-emacs-lisp-eieio-tests"
test-lisp-emacs-lisp-faceup-tests-inotify:
stage: normal
- test/lisp/emacs-lisp/faceup-tests/*resources/**
variables:
target: emacs-inotify
- make_params: "-C test check-lisp-emacs-lisp-faceup-tests"
+ make_params: "-k -C test check-lisp-emacs-lisp-faceup-tests"
test-lisp-emulation-inotify:
stage: normal
- test/lisp/emulation/*resources/**
variables:
target: emacs-inotify
- make_params: "-C test check-lisp-emulation"
+ make_params: "-k -C test check-lisp-emulation"
test-lisp-erc-inotify:
stage: normal
- test/lisp/erc/*resources/**
variables:
target: emacs-inotify
- make_params: "-C test check-lisp-erc"
+ make_params: "-k -C test check-lisp-erc"
test-lisp-eshell-inotify:
stage: normal
- test/lisp/eshell/*resources/**
variables:
target: emacs-inotify
- make_params: "-C test check-lisp-eshell"
+ make_params: "-k -C test check-lisp-eshell"
test-lisp-gnus-inotify:
stage: normal
- test/lisp/gnus/*resources/**
variables:
target: emacs-inotify
- make_params: "-C test check-lisp-gnus"
+ make_params: "-k -C test check-lisp-gnus"
test-lisp-image-inotify:
stage: normal
- test/lisp/image/*resources/**
variables:
target: emacs-inotify
- make_params: "-C test check-lisp-image"
+ make_params: "-k -C test check-lisp-image"
test-lisp-international-inotify:
stage: normal
- test/lisp/international/*resources/**
variables:
target: emacs-inotify
- make_params: "-C test check-lisp-international"
+ make_params: "-k -C test check-lisp-international"
test-lisp-mail-inotify:
stage: normal
- test/lisp/mail/*resources/**
variables:
target: emacs-inotify
- make_params: "-C test check-lisp-mail"
+ make_params: "-k -C test check-lisp-mail"
test-lisp-mh-e-inotify:
stage: normal
- test/lisp/mh-e/*resources/**
variables:
target: emacs-inotify
- make_params: "-C test check-lisp-mh-e"
+ make_params: "-k -C test check-lisp-mh-e"
test-lisp-net-inotify:
stage: normal
- test/lisp/net/*resources/**
variables:
target: emacs-inotify
- make_params: "-C test check-lisp-net"
+ make_params: "-k -C test check-lisp-net"
test-lisp-nxml-inotify:
stage: normal
- test/lisp/nxml/*resources/**
variables:
target: emacs-inotify
- make_params: "-C test check-lisp-nxml"
+ make_params: "-k -C test check-lisp-nxml"
test-lisp-obsolete-inotify:
stage: normal
- test/lisp/obsolete/*resources/**
variables:
target: emacs-inotify
- make_params: "-C test check-lisp-obsolete"
+ make_params: "-k -C test check-lisp-obsolete"
test-lisp-org-inotify:
stage: normal
- test/lisp/org/*resources/**
variables:
target: emacs-inotify
- make_params: "-C test check-lisp-org"
+ make_params: "-k -C test check-lisp-org"
test-lisp-play-inotify:
stage: normal
- test/lisp/play/*resources/**
variables:
target: emacs-inotify
- make_params: "-C test check-lisp-play"
+ make_params: "-k -C test check-lisp-play"
test-lisp-progmodes-inotify:
stage: normal
- test/lisp/progmodes/*resources/**
variables:
target: emacs-inotify
- make_params: "-C test check-lisp-progmodes"
+ make_params: "-k -C test check-lisp-progmodes"
test-lisp-so-long-tests-inotify:
stage: normal
- test/lisp/so-long-tests/*resources/**
variables:
target: emacs-inotify
- make_params: "-C test check-lisp-so-long-tests"
+ make_params: "-k -C test check-lisp-so-long-tests"
test-lisp-term-inotify:
stage: normal
- test/lisp/term/*resources/**
variables:
target: emacs-inotify
- make_params: "-C test check-lisp-term"
+ make_params: "-k -C test check-lisp-term"
test-lisp-textmodes-inotify:
stage: normal
- test/lisp/textmodes/*resources/**
variables:
target: emacs-inotify
- make_params: "-C test check-lisp-textmodes"
+ make_params: "-k -C test check-lisp-textmodes"
test-lisp-url-inotify:
stage: normal
- test/lisp/url/*resources/**
variables:
target: emacs-inotify
- make_params: "-C test check-lisp-url"
+ make_params: "-k -C test check-lisp-url"
test-lisp-vc-inotify:
stage: normal
- test/lisp/vc/*resources/**
variables:
target: emacs-inotify
- make_params: "-C test check-lisp-vc"
+ make_params: "-k -C test check-lisp-vc"
test-misc-inotify:
stage: normal
- test/misc/*resources/**
variables:
target: emacs-inotify
- make_params: "-C test check-misc"
+ make_params: "-k -C test check-misc"
test-src-inotify:
stage: normal
- test/src/*resources/**
variables:
target: emacs-inotify
- make_params: "-C test check-src"
+ make_params: "-k -C test check-src"