Setting default Working Directory for Applications to use module dir

I work on a team where the majority of developers are Eclipse users.  The unit tests we have do some file loading using relative paths that assume that the working directory is the directory of the module (in Idea speak) or the project (in Eclipse-land).  This is the default behavior for Eclipse.  Is there any way to configure Idea so that when I launch the unit tests for a particular module that it will set the working directory to be the root of that module, a la Eclipse?

2 comments
Comment actions Permalink

I use Jerkar as my build tool. It enable to launch build as a main method on a class.

It assumes that the working dir is the module dir (as in Eclipse) . Having the possibility to set it as default would lead in better integration.

0
Comment actions Permalink

Similarly, could it check my build.gradle for statements like:

test {
    forkEvery 1
    workingDir = "build/test"
}

and then set the work dir for unit tests automatically?

For my team, some unit tests create random files and directories in the current working directory, so it gets messy.

0

Please sign in to leave a comment.