(in-package :qt.tests) (5am:in-suite :qt.suite) ;;; FIXME implement something sensibel and test ;;; that it realy tests for races. (defmacro parallel-test (&body body) "Executes BODY concurrently by using threads and tests wherther all tests are successfull." (let ((threads (gensym)) (thread (gensym))) `(let ((,threads nil)) (with-timeout (5) (dotimes (,(gensym) 2) (push (make-thread #'(lambda () ,@body)) ,threads)) (dolist (,thread ,threads) (5am:is (eql (5am:results-status (join-thread ,thread)) t))))))) #| (5am:test (bytearray-threads :depends-on bytearray) "Concurrent qbytearray creation." (parallel-test (dotimes (x 5) (5am:run 'bytearray)))) |# ;; FIXME this test does not work realibly #| (5am:test (gc-object-threads :depends-on gc-object) "Concurrent garbage collenction." (parallel-test (dotimes (x 2) (5am:run 'gc-object)))) |#