The overlay half is checked as far as --batch allows and no further: execute-kbd-macro runs no pre-command-hook there, so the hook is proved installed in the right buffer and in nobody else's, and proved to clear and uninstall when run — which is what the command loop does with it. That Emacs runs it is Emacs' contract, and a test pretending to check it would be checking nothing.