test event loop in background
Sat Jun 6 17:07:40 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* test event loop in background
hunk ./src/package.lisp 1
+(eval-when (:load-toplevel :compile-toplevel)
+ (unless (member :slime *features*)
+ (when (find-package :swank)
+ (push :slime *features*))))
+
hunk ./src/package.lisp 9
- #:start-event-loop-in-repl
+ #+slime #:start-event-loop-in-repl
hunk ./src/repl.lisp 29
+ #+slime
hunk ./src/repl.lisp 49
+ #+slime
hunk ./src/repl.lisp 69
- (terminal-io *terminal-io*))
+ (terminal-io *terminal-io*)
+ (ready-lock (bt:make-lock))
+ (ready (bt:make-condition-variable)))
hunk ./src/repl.lisp 73
+ #+slime
hunk ./src/repl.lisp 84
- (format t "exec~%")
- (qt:exec)
- (format t "exec-done~%")))
- :name "Qt Event Loop")))
+ (qt:do-delayed-initialize [_$_]
+ (bt:condition-notify ready))
+ (qt:exec)))
+ :name "Qt Event Loop")
+ (bt:with-lock-held (ready-lock)
+ (bt:condition-wait ready ready-lock))))
hunk ./src/repl.lisp 91
+#+slime
addfile ./test.lisp
hunk ./test.lisp 1
+;;; sbcl < test.lisp
+;;;
+;;; somehow #'LOADing the test file hangs WITH-APP!?
+;;; Thus the pipe
+;;;
+
+(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 (first (directory "*.mbd"))
+ system-name))
+
+(load-sysdef-file :cl-smoke.repl)
+(mb:load :cl-smoke.repl)
+
+(in-package :cl-smoke.repl)
+
+(defun test-event-loop-in-background ()
+ (start-event-loop-in-background)
+ (qt-eval '(defvar *w* (make-instance 'qt:push-button)))
+ (qt-eval '(cxx:show *w*))
+ (qt-eval '(setf (cxx:text *w*) "Hello World!"))
+ (qt-eval '(assert (string= "Hello World!" (cxx:text *w*))))
+ (qt-eval '(cxx:adjust-size *w*))
+ (qt-eval '(in-package :smoke))
+ (qt-eval '(assert (eql (find-package :smoke) *package*)))
+ (qt-eval '(end-event-loop)))
+
+(test-event-loop-in-background)
+
+(print "success")
+
+(sb-ext:quit)
addfile ./test.sh
hunk ./test.sh 1
+#!/bin/sh
+sbcl < test.lisp
+exit $?
changepref test
sh ./test.sh