Sun May 24 17:00:42 CEST 2009 Tobias Rautenkranz * Testrun examples on commit diff -rN -u old-qt.examples/src/repl.lisp new-qt.examples/src/repl.lisp --- old-qt.examples/src/repl.lisp 2014-10-30 07:38:13.000000000 +0100 +++ new-qt.examples/src/repl.lisp 2014-10-30 07:38:13.000000000 +0100 @@ -12,13 +12,14 @@ :initform (make-instance 'qt:line-edit))) (:metaclass cxx:class)) + (defun append-list-model (list-model string) "Appends STRING to LIST-MODEL." (let ((index (cxx:row-count list-model))) (unless (cxx:insert-row list-model index) (error "insert-row ~A for ~A failed." index list-model)) - (cxx:set-data list-model (cxx:index list-model index) - (qt:make-variant string)))) + (unless (cxx:set-data list-model (cxx:index list-model index) string) + (error "set-data failed.")))) (defmethod initialize-instance :after ((repl repl) &rest args) (declare (ignore args)) @@ -30,10 +31,11 @@ (format nil "> ~A" (cxx:text (input repl)))) (append-list-model ;; return value (model repl) - (format nil "~S" - (handler-case (eval (read-from-string (cxx:text (input repl)))) - (error (condition) condition)))) - (setf (cxx:text (input repl)) ""))) + (write-to-string + (handler-case (eval (read-from-string + (cxx:text (input repl)))) + (error (condition) condition)))) + (cxx:clear (input repl)))) (let ((layout (make-instance 'qt:vbox-layout))) (cxx:add-widget layout (output repl)) (cxx:add-widget layout (input repl)) diff -rN -u old-qt.examples/test.lisp new-qt.examples/test.lisp --- old-qt.examples/test.lisp 1970-01-01 01:00:00.000000000 +0100 +++ new-qt.examples/test.lisp 2014-10-30 07:38:13.000000000 +0100 @@ -0,0 +1,23 @@ +#| +exec -a "$0" sbcl --noinform --noprint --disable-debugger --load $0 --end-toplevel-options "$@" +|# + + +(in-package :sysdef-user) + +(defun load-sysdef (pathname system) + (load pathname) + (setf (mb.sysdef::pathname-of (find-system system)) pathname)) + +(defun load-sysdef-file (system-name) + "Loads a mbd file in the current directory." + (load-sysdef (make-pathname :defaults *default-pathname-defaults* + :name (string-downcase system-name) + :type "mbd") + system-name)) + +(load-sysdef-file :qt.examples) +(mb:clean :qt.examples) +(mb:test :qt.examples) + +(sb-ext:quit) diff -rN -u old-qt.examples/tests/test.lisp new-qt.examples/tests/test.lisp --- old-qt.examples/tests/test.lisp 1970-01-01 01:00:00.000000000 +0100 +++ new-qt.examples/tests/test.lisp 2014-10-30 07:38:13.000000000 +0100 @@ -0,0 +1,9 @@ +(in-package :qt.examples) + +(let ((qt:*exec-p* nil)) + (do-external-symbols (example :qt.examples) + (when (fboundp example) + (format *debug-io* "testing ~A~%" + (documentation (symbol-function example) + 'function)) + (funcall (symbol-function example)))))