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 *):
*burgers1d_galerkin
*burgers1d_lspg
burgers1d_sparse_jacobian.py
cmake_install.cmake
CMakeCache.txt
*CMakeFiles
Makefile
pressio4py.cpython-36m-darwin.so
test_burgers1d_galerkin.py
test_burgers1d_lspg.py
test_decoder.py
test_wrapper_module.cpython-36m-darwin.so
test_wrapper.py
*tests
what I would like is to have all tests inside tests, which means tests should have the same structure that is has in the source as follows:
tests
/regression
/burgers1d_galerkin
/burgers1d_lapg
/unit
test_decoder.py
test_wrapper.py
test_wrapper_module.cpython-36m-darwin.so
and the top-level build then looks like this:
cmake_install.cmake
CMakeCache.txt
*CMakeFiles
Makefile
pressio4py.cpython-36m-darwin.so
*tests
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 meanstestsshould have the same structure that is has in the source as follows:tests /regression /burgers1d_galerkin /burgers1d_lapg /unit test_decoder.py test_wrapper.py test_wrapper_module.cpython-36m-darwin.soand the top-level build then looks like this: