closes#1469
`lein run` currently has some special error handling around
FileNotFoundException which helps it decide what exactly it should
do. Unfortunately if the actual running of the given main function
itself throws a FileNotFoundException this is currently caught by
Leiningen and assumed to be a require error.
The simple solution is to run the main method outside of that error
handling block.
Regression test provided.
According to the [jar file specification](http://docs.oracle.com/javase/7/docs/technotes/guides/jar/jar.html)
> For resource files with non-empty directory prefixes, mappings are also
> recorded at the directory level. Only for classes with null package
> name, and resource files which reside in the root directory, will the
> mapping be recorded at the individual file level.
If needed, directory entries may be excluded using `:jar-exclusions`
regex like `#"^.*/$"`.
The old method skipped tests by adding a hook to
clojure.test/test-var, the problem being that :each fixtures
associated with the test have already run at that point, which is
unideal.
This change skips test by removing their :test metadata before running
the tests at all, which causes clojure.test to not see it as a test.
We use ns-interns to enumerate the vars, the same way clojure.test
does.
lein run tries to support invoking static methods on classes by
swallowing FileNotFoundExceptions when requiring the namespace to run,
which can obscure the real error when there's a real issue loading a
namespace.
Phil said he wasn't interested in keeping the (undocumented) feature
around, so the easiest fix to the error message problem was to remove
that feature.
Added a test as well.
More specific metadata wins, e.g. deftest trumps its namespace.
Also tweaked the tests a bit so that actual/expected results are now
shown in the output.
The test.helper needed to change the project map for the test projects
because eval-in-project uses get-classpath, which will return the
relative paths for some directories. This breaks in this case since
the working directory is not the root of the test project.