On Feb 16, 2:12 am, Mike Meyer <mwm-keyword-googlegroups.
620...@mired.org> wrote:
> Wouldn't be hard to do, either. Just bind *script-name* (or some such)
> to the path in script-opt, and let the client decide if it's the same
> as *file*.

It would indeed be helpful if clojure.main bound a Var to the name of
the .clj file being run, sort of like argv[0] in C. Like Michał
suggested, there's the gen-class solution, but I personally tend avoid
AOT-compiling Clojure code, which rules out gen-class.

> > > What I'd like to do is make my unit tests usable in two modes: While
> > > working on a bug, I'd like to be able to load them in the REPL to
> > > rerun the subset of interest - possibly just the test which is
> > > failing. However, I'd also like to be able to feed the script to
> > > clojure.main with something like "clj test.clj" and have it run them
> > > all.

This seems to be a common idiom, especially in the Python community.
clojure.contrib and other Clojure projects seem to follow a different
philosophy: Keep your unit tests in a separate tests/ directory and
invoke them through a Maven/Ant/Leiningen task.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to