One Approach

Here's a cute trick I've evolved:

I'm a great fan of unit test first, as described by eXtremeProgramming on TheOriginalWiki.

With the code below, I can press F12 and immediately run all of my unit tests, and immediately see whether they all passed or not.
I've put all of my unit tests into their own file with a main function that runs the tests and gives an exitcode according to the test results. I've specified that the compile-command for that file compiles and runs the file.

This elisp code will run the compile command from the F12 key in emacs. The output will popup a new window twelve lines tall. If the compilation is successful (exitcode zero) the window goes away. If the exitcode is 1 or greater, the window stays so you can see the output.