Does anyone have experience in adding a relative path in the Project Path field of a TestInfo root for testcases (like editor or node test cases)? I have tried all kinds of ways to make the path relat...
This is an auto-generated question from the MPS Slack community: Does anyone have experience in adding a relative path in the Project Path field of a TestInfo root for testcases (like editor or node test cases)? I have tried all kinds of ways to make the path relative, but get MPS only to accept absolute paths, which seems at odds with the documentation (but at the same time, I cannot find an example in the documentation of a relative path).
4 comments
Sort by
Date
Votes
I think the path can't be relative (with ../) because the tests open an MPS project which needs an absolute path. You can use path variables as stated in the documentation or specify the path relative to the working directory.
Example (Mac paths): A test configuration with `TestInfo.projectPath = mpsUser/projects/mpsProject` and working `directory = /Users` is equal to a configuration with `projectPath = /Users/mpsUser/projects/mpsProject` and working directory=`/` (root folder)
Thanks a lot Alexander! Maybe another stupid question: do you mean by 'working directory' the directory from which I started MPS? Or is that something you can set as well? If it's the former, then my feeling is that this kind of relative path is pretty useless because it depends on where someone boots up their MPS...
The reason that I asked this question at all is because I didn't want to use path variables (having a bunch of different project with small variations for a training and not wanting to set a separate path variable for each).
It is the directory from which you started MPS and is stored here:`System.getProperty('user.dir').` It is not recommended to change this property in Java (although you can), so it is probably useless.
This is auto-generated question from the MPS Community Slack Workspace. If you want to comment on the question, do it from the Slack workspace
Post is closed for comments.