Bochlin / vunit-test-explorer

VUnit test explorer for VSCode
MIT License
12 stars 5 forks source link

Change working directory to where "run.py" is located #2

Closed Gzah92 closed 4 years ago

Gzah92 commented 4 years ago

Thanks again for the great extension!

Currently the working directory behavior is unexpected to me: With standalone VUnit it's set to the script location, while in the extension it's the workspace location. So if you expect the script location relative paths for the source files in "run.py" don't match up anymore.

While it can easily be fixed by using absolute paths in the script, I think a behavior identical to the standalone version would ease the integration.

Bochlin commented 4 years ago

I'm not sure that VUnit has any convention for the working directory, most of the examples make all paths relative to the directory of run.py explicitly in the script e.g:

SRC_PATH = Path(__file__).parent / "src"

The output path defaults to a folder in the current working directory. I would agree though that the directory of the run,py files makes for a more sensible default. Adding a property to configure the working directory would make sense as well.

Gzah92 commented 4 years ago

Today I showed a colleague the extension, and he had trouble getting it to run exactly because of this issue. I'll create a pull request for this tomorrow if it's fine with you.

Bochlin commented 4 years ago

That would be great.