egiles/test-compile — pull request #2 by schwern (2014-03-14 00:43:22+00:00)
Title: require, don't use, modules.  Also display the compilation error.

These patches do two major things.

First, it now uses "require" rather than "use". This avoids calling import(). Test::Compile is testing that a module compiles. Calling import() is running code. That's testing the runtime, not just compilation. It can also have odd effects if it's a pragma or a module that needs some setup.

Second, it now shows the compilation failure as a diagnostic. This is a great help to debugging. Especially useful for heisenbugs! It's possible a compilation error will produce a large trace, so maybe it should be truncated after a few lines.

I also cleaned up a few minor things along the way. See commit logs for details.