You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now we have to copy the python test files into the same directory as the .so file so we can easily import pressio4py into the python test files. We want to place the test files in the correct subfolders. One option is to add a temporary python path in the beginning of the .py test file so that the python file doesn’t have to be in the same directory as the python .so file. Alternatively, we need to look for a method to somehow temporarily add a path to the python file (similar to the addpath functionality) but using a cmake directive in case we might need to change the directory structure.
Right now, when you build you get this structure (subdirectories are marked with *):
After some quick googling, there might be three options here:
Move all test files to their respective folders and just add an "addpath" line to the beginning of the test*py file that includes the directory of the .so file
There might be an option in pytest to temporarily define a python path when you call pytest from the command line. But then the user has to know where the .so file is in the build directory.
CMAKE's ctest function might be able to handle the execution of pytest all together. I think you can define pytest as the command to perform the test in CMAKE. This last option could work in combination with (1) and (2).
I will try (1) since that is the easiest, and then see if (2) or (3) is a possibility.
Move all test files to their respective folders and just add an "addpath" line to the beginning of the test*py file that includes the directory of the .so file
This is fine with me!
Please keep the structure consistent between source and build like said above.
We can now do this. We just need to setup the relative paths correctly so that when we import modules in the test scripts it find the right libraries. Let's discuss soon.
Right now we have to copy the python test files into the same directory as the .so file so we can easily import pressio4py into the python test files. We want to place the test files in the correct subfolders. One option is to add a temporary python path in the beginning of the .py test file so that the python file doesn’t have to be in the same directory as the python .so file. Alternatively, we need to look for a method to somehow temporarily add a path to the python file (similar to the addpath functionality) but using a cmake directive in case we might need to change the directory structure.
Right now, when you build you get this structure (subdirectories are marked with *):
what I would like is to have all tests inside
tests
, which meanstests
should have the same structure that is has in the source as follows:and the top-level build then looks like this:
The text was updated successfully, but these errors were encountered: