anchor.diff:                                          :flow-control :none
                                           :stop-bits 1 t
                                           :external-format (ccl::make-external-format :line-termination :CRLF)))
  +
  +(defvar *test-case* (list
  +                     ;;app-name (key list) period repeat
  +                     (list "HDPPlayer"
  +                           (list "up" "down") 100 6)
  +                     (list "tvplayer"
  +                           (list "up" "down" "right" "enter") 100 6)
  +                     (list "desktop"
  +                           (list "up" "down" "right" "enter" "back" "home") 10 10)
  +                     ))
  +(setq *test-case* (list
  +                     ;;app-name (key list) period repeat
  +                     (list "HDPPlayer"
  +                           (list "up" "down") 100 6)
  +                     (list "tvplayer"
  +                           (list "up" "down" "right" "enter") 100 6)
  +                     (list "desktop"
  +                           (list "up" "down" "right" "enter" "back" "home") 10 10)
  +                     ))
   
   (defun string-in-list (str)
     (loop for i in *list-string*
  
positive.code:   (sleep 0.01)
    (format serial "~%")
    (force-output serial)
    (format t "serial output ~a~%" str)
    (sleep 1))
  
  (defun wait-shell (serial comm timeout)
  
negative.code:     (loop while t
            do
               (let ((s (serial-log-search result))
                     (f (if fail-result (serial-log-search fail-result) nil))
                     (cont t))
                 (if (and f fail-result)
                     (progn
                       (when error
                         (setq cont (funcall error f)))
                       (if cont
                           (progn
                             (format t "failed,run retry~%")
                             (wait-shell serial "" 10)
                             (serial-log-clear)
                             (serial-force-output serial comm)
                             (sleep 2))
                           (progn
                             (serial-log-clear)
                             (return f)))
                       )
                     (if s
                         (progn
                           (format t "wait ~a result ~a success~%" comm result)
                           (when collect
                             (setq s (funcall collect *serial-log*)))
                           (serial-log-clear)
                           (return s))))
                 )
            )))
  