One idea might be to save a copy of the current buffer, run the tests, and then run a diff command on them. (defun run-tests () (interactive) (copy-to-buffer "*my-test*" (point-min) (point-max)) (org-babel-execute-buffer) (diff-buffers "*my-test*" (current-buffer))) This will make a new buffer showing the diff (if any). There are lots of variations I suppose, like writing to files, different ways of diffing. It would be hard I think to get this to work for images.