Commit 8470929a authored by Vladimir Sedach's avatar Vladimir Sedach

Added script to run tests in multiple implementations using Roswell

parent f7055c50
#!/usr/local/bin/sbcl --script
;;; roughly in order of how long the tests take to run
(defvar implementations '("sbcl-bin" "ccl-bin" "allegro" "clisp"
"ecl" "abcl-bin"))
(let ((installed (with-output-to-string (out)
(sb-ext:run-program "ros" '("list" "installed")
:search t :output out))))
(dolist (implementation implementations)
(unless (search implementation installed)
(write-string "Installing ") (write-line implementation)
(sb-ext:run-program "ros" (list "install" implementation)
:search t :output t)
(terpri))))
(write-line "Starting tests")
(defvar test-code
"(setq *debugger-hook*
(lambda (condition x)
(declare (ignore x))
(let ((*standard-output* uiop:*stderr*))
(fresh-line)
(write-string \"Debugger entered with error \")
(princ (type-of condition))
(write-string \": \")
(princ condition)
(terpri)
(uiop:quit 1))))
(ql:quickload \"uri-template2/test\")
(setq fiveam:*print-names* nil)
(let ((fiveam:*test-dribble* uiop:*stderr*)
(test-results (fiveam:run :uri-template2)))
(unless (fiveam:results-status test-results)
(fiveam:explain! test-results)
(uiop:quit 1)))")
;;; make sure ASDF is loading the system from the current directory
(require :sb-posix)
(sb-posix:setenv "CL_SOURCE_REGISTRY"
(directory-namestring *load-truename*)
1)
(dolist (implementation implementations)
(write-string "Running tests in ") (write-string implementation)
(finish-output)
(let* ((stderr (make-string-output-stream))
(exit-code
(sb-ext:process-exit-code
(sb-ext:run-program
"ros"
(list "run" "-L" implementation "-e" test-code "-q")
:search t :error stderr))))
(if (/= 0 exit-code)
(progn (write-line ": FAILURE")
(write-string "Error running tests in " *error-output*)
(write-line implementation *error-output*)
(write-string (get-output-stream-string stderr)
*error-output*)
(sb-ext:exit :code 1))
(write-line ": SUCCESS"))))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment