diff --git a/run-tests.ros b/run-tests.ros index d4d2158..16c63a5 100755 --- a/run-tests.ros +++ b/run-tests.ros @@ -6,7 +6,8 @@ exec ros -Q -- $0 "$@" (progn ;;init forms (ros:ensure-asdf) #+quicklisp - (ql:quickload "trivial-backtrace" + (ql:quickload (list "trivial-backtrace" + "log4cl") :silent t) #+(or sbcl ccl) (ql:quickload "cl-coveralls" @@ -30,6 +31,9 @@ exec ros -Q -- $0 "$@" (defun guess-test-system-name (primary-system-name) (check-type primary-system-name string) + (format t "TRACE: Guessing test system name for ~A~%" + primary-system-name) + (loop for template in *test-system-name-templates* for system-name = (format nil template primary-system-name) @@ -50,6 +54,9 @@ exec ros -Q -- $0 "$@" (let ((test-system-name (guess-test-system-name primary-system-name))) + (format t "TRACE: guessed test system name is ~A~%" + test-system-name) + (ql:quickload test-system-name :silent t) ;; ASDF:TEST-SYSTEM always returns T @@ -89,27 +96,46 @@ exec ros -Q -- $0 "$@" "Please specify ASDF system as a first argument.~%") (uiop:quit 1)) - (let* ((user-script (unless (interactive-stream-p *standard-input*) - (uiop:slurp-stream-forms *standard-input*))) + (let* ((user-script-as-str + (unless (interactive-stream-p *standard-input*) + (format t "TRACE: reading user-script from standard input~%") + (let* ((raw (uiop:slurp-stream-string *standard-input*)) + (stripped (string-trim '(#\Newline #\Space #\Tab) + raw))) + (unless (zerop (length stripped)) + stripped)))) + (user-script + (when user-script-as-str + (format t "TRACE: parsing this user-input:~%~A~%" + user-script-as-str) + (let ((stream (make-string-input-stream user-script-as-str))) + (uiop:with-safe-io-syntax () + (uiop:slurp-stream-forms stream))))) (coveralls-repo-token - (let* ((value (uiop:getenv "COVERALLS_REPO_TOKEN")) - ;; Sometimes user might want to use multiline - ;; YAML format to make expression more readable. - ;; In this case the value might contain hanging - ;; spaces and new-lines. - (value (string-trim '(#\Newline #\Space) value))) - (cond - ((or (null value) - ;; When using GH Actions expressions like: - ;; ${{ matrix.lisp == 'sbcl-bin' && secrets.github_token }} - ;; the value will be 'false' for any lisp other than 'sbcl-bin' - (string-equal value "false") - (string-equal value "")) - nil) - (t value)))) + (progn + (format t "TRACE: makeing coveralls repo token~%") + + (let* ((value (uiop:getenv "COVERALLS_REPO_TOKEN")) + ;; Sometimes user might want to use multiline + ;; YAML format to make expression more readable. + ;; In this case the value might contain hanging + ;; spaces and new-lines. + (value (string-trim '(#\Newline #\Space) value))) + (cond + ((or (null value) + ;; When using GH Actions expressions like: + ;; ${{ matrix.lisp == 'sbcl-bin' && secrets.github_token }} + ;; the value will be 'false' for any lisp other than 'sbcl-bin' + (string-equal value "false") + (string-equal value "")) + nil) + (t value))))) (result (progn + (format t "TRACE: makign result 1~%") + (when coveralls-repo-token + (format t "TRACE: makign result 2~%") ;; This will enable data collection ;; inside with-coveralls: (setf (uiop:getenv "COVERALLS") @@ -118,9 +144,13 @@ exec ros -Q -- $0 "$@" (setf (uiop:getenv "COVERALLS_REPO_TOKEN") coveralls-repo-token)) + (format t "TRACE: makign result 3~%") (with-coveralls (:exclude (list ".qlot/")) + (format t "TRACE: makign result 4~%") (cond (user-script + (format t "TRACE: processing user-script:~%~S~%" + user-script-as-str) (loop with form-results for form in user-script do (setf form-results @@ -128,6 +158,8 @@ exec ros -Q -- $0 "$@" finally (return form-results))) ;; default tests runner (t + (format t "TRACE: running tests for system \"~A\"~%" + system) (run-tests system))))))) (unless result (uiop:quit 2))))