anchor.diff:    `(let ((qapp (ensure-qapplication)))
        (declare (ignorable qapp))
        ,@body))
  +
  +;; CommonQt reader macro works by defining some new macros.
  +;; This is ok for ordinary compilation but with RT test
  +;; cases the macroexpansion is done when tests are run,
  +;; and the newly defined macros don't make it into fasls,
  +;; so loading compiled tests fails. We have to put the
  +;; test body into separate defun, sacrificing runtime
  +;; macro expanding.
  +
  +(defmacro deftest/qt (name form &rest values)
  +  (alexandria:with-gensyms (func-name)
  +    `(progn
  +       (defun ,func-name () (with-qapp ,form))
  +       (deftest ,name (,func-name) ,@values))))
   
   (let ((bad (cons nil nil)))
     (defun remarshal (value type &optional with-const-p)
  
positive.code:     "QList<QVariant>" t
    () ("abc") ("" 123 "zzz" 456))
  
  (deftest test-qobjectlist-marshalling
      (with-qapp
        (let ((a (#_new QObject))
              (b (#_new QPushButton "Def"))
              (c (#_new QLabel "zzz")))
          (#_setObjectName a "Abc")
          (flet ((extract (list)
                   (list
                    (#_objectName (first list))
                    (#_text (second list))
                    (#_text (third list)))))
            (extract (remarshal (list a b c) "QList<QObject*>" t)))))
    ("Abc" "Def" "zzz"))
  
  (deftest test-item-model-stuff-marshalling
      (with-qapp
        (let ((model (#_new QStandardItemModel)))
          (#_appendRow model (list (#_new QStandardItem "01")
                                   (#_new QStandardItem "bca")))
          (#_appendRow model (list (#_new QStandardItem "02")
                                   (#_new QStandardItem "abc")))
          (#_appendRow model (list (#_new QStandardItem "03")
                                   (#_new QStandardItem "bcq")))
          (values
            (iter (for item in (remarshal (list (#_new QStandardItem "zz")
                                                (#_new QStandardItem "rr"))
                                          "QList<QStandardItem*>"))
                  (collect (#_text item)))
            (iter (for i from 0 to 2)
                  (collect (cons (#_data model (#_index model i 0))
                                 (#_data model (#_index model i 1)))))
            (iter (for index in (#_match model (#_index model 0 1)
                                         (#_Qt::DisplayRole) "bc" -1))
                  (collect (cons (#_row index) (#_column index))))
            (iter (for index in (remarshal (#_match model (#_index model 0 1)
                                                    (#_Qt::DisplayRole) "bc" -1)
                                           "QList<QModelIndex>"))
                  (collect (cons (#_row index) (#_column index)))))))
    ("zz" "rr") (("01" . "bca") ("02" . "abc") ("03" . "bcq"))
    ((0 . 1) (2 . 1)) ((0 . 1) (2 . 1)))
  
  
negative.code:         result))))
  
  (defmacro define-marshalling-test (name type with-const-p &rest values)
    `(deftest/qt ,name
         (values ,@(iter (for val in values)
                         (collect `(remarshal ',val ,type ,with-const-p))))
       ,@values))
  
  (define-marshalling-test test-qbytearray-marshalling
  