#2406 How to run tests on script thats not in the home dir?

elyashiv Wed 1 Apr 2015

I have a build script that sets outPodDir to `./bin/`. When running the tests I get a error saying fant can't find the pod. How can I resolve this?

brian Wed 1 Apr 2015

Are you talking about scripts or pods? Scripts don't really care what directory they are in. Typically for pods you setup a working environment - see docLang::Env. If you want to make it based on your current directory, then you can stick a fan.props file in the root of your working directory to implicitly set that as your working directory (that is how I work).

/work/fan/
/work/fan/lib/...
/work/foo/
/work/foo/fan.props  // can make this empty file
/work/foo/lib/...

elyashiv Wed 1 Apr 2015

Thanks, it works great. Just one more question: where is the documentation for fan.props files?

brian Wed 1 Apr 2015

The fan.props is a bit of a backdoor we never really documented properly :) It was a prototype, but we've been using it for years pretty well so probably should document it

SlimerDude Thu 2 Apr 2015

fan.props eh? Cool, you learn something new everyday!

@elyashiv, if you've not already, you may want to check out PathEnv. By setting some environment variables you can set up a work directory where pods and config files are saved to / loaded from; thus leaving the Fantom installation directory clean.

SlimerDude Thu 6 Aug 2015

Just wondering, what else is the fan.props used for?

I really like the idea of a local project dir being used to set / override pod versions (similar to how node and npm works). But I see projects being centred around build.fan not fan.props.

brian Thu 6 Aug 2015

It really is just another way to setup your PathEnv using a file instead of environment variables. We also recently added hook to override env vars using props prefixed with "env.". If you look at util::PathEnv.makeProps you can see what it does.

Login or Signup to reply.