-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added tests #58
added tests #58
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks. Move the tests to src/xGadgetron/pGadgetron/tests/CMakeLists.txt
(and same for STIR). That's where we know what tests are available. (add an add_directory
in the level above).
Now one adds tests definition in the appropriate x<>/p<>/tests/CMakeLists.txt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some clean-up needed
src/xSTIR/pSTIR/CMakeLists.txt
Outdated
@@ -40,3 +40,5 @@ if(BUILD_PYTHON) | |||
INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/pystir.py" pStir.py DESTINATION "${PYTHON_DEST}") | |||
|
|||
endif(BUILD_PYTHON) | |||
|
|||
ADD_SUBDIRECTORY(tests) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move inside the if, to avoid this to be included if Python-stuff not built
# limitations under the License. | ||
# | ||
#========================================================================= | ||
ENABLE_TESTING() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need for this as in top-level (probably should be there only)
CMakeLists.txt
Outdated
include(FindPythonInterp) | ||
add_test(NAME MR_FULLY_SAMPLED | ||
COMMAND ${PYTHON_EXECUTABLE} src/xGadgetron/pGadgetron/tests/fully_sampled.py) | ||
#include(FindPythonInterp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer not to have the commented-out stuff here...
I have moved the tests in Unfortunately, for some reasons I did not figure out yet, the STIR tests are not found. |
CMakeLists.txt
Outdated
@@ -74,6 +74,16 @@ endif() | |||
|
|||
#### enable support for ctest | |||
ENABLE_TESTING() | |||
#include(FindPythonInterp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's remove these comments
looks good but a few comments remaining. no clue why it doesn't find the pStir test. sorry. |
I checked today and it's fine. The problem I was facing yesterday was due to the fact that cmake didn't find STIR, hence the pSTIR tests were not run. It's all fine when built from the SuperBuild which sets all variables. |
great. thanks. Would you be able to put the enable_testing() in the main file, you've just commented it out :-; and remove it from the others? That looks a bit cleaner to me. |
perfect. ready to accept? Prefer a merge or a squash-merge? (see email) |
I guess squash-merge |
without it the added tests are not added. This commit somehow undoes last commit.
currently the tests are not found in the directory of the build. they aren't there and this is a workaround to point the system to the right location: The system issues python from /home/sirfuser/devel/SIRF-SuperBuild/SIRF-prefix/src/SIRF-build/src/xGadgetron/pGadgetron/tests and there are no test files there. 3 Testing: MR_UNDER_SAMPLED 3/3 Test: MR_UNDER_SAMPLED Command: "/usr/bin/python2.7" "/home/sirfuser/devel/SIRF-SuperBuild/SIRF-prefix/src/ SIRF-build/src/xGadgetron/pGadgetron/tests/../../../../../../../SIRF/src/xGadgetron/ pGadgetron/tests/undersampled.py" Directory: /home/sirfuser/devel/SIRF-SuperBuild/SIRF-prefix/src/SIRF-build/src/xGadg etron/pGadgetron/tests
but the same doc says
it doesn't make sense to me (and it isn't needed in STIR). @paskino, are you sure we need this? |
By the way, you will need to merge master onto here for final testing. @evgueni-ovtchinnikov fixed filenames and "case" of directory, so this might affect this PR. |
use WORKING_DIRECTORY directive and ${CMAKE_PREFIX_PATH} to determine the right location of the test files. It's not different as before but much better looking. Removed ADD_TESTING(). Discard my previous comment about this not working if in the main CMakeLists.txt
good to know! I actually struggled to find that variable! All right, I'll fix it next week then. |
use CMAKE_SOURCE_DIR rather than CMAKE_PREFIX_PATH to set the path to the test files.
# limitations under the License. | ||
# | ||
#========================================================================= | ||
include(FindPythonInterp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@KrisThielemans I'm assuming this is overriding travis' PYTHON_EXECUTABLE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why would this happen only on one of the systems in the travis matrix?
# | ||
#========================================================================= | ||
include(FindPythonInterp) | ||
add_test(NAME PET_TEST1 COMMAND ${PYTHON_EXECUTABLE} test1.py WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src/xSTIR/pSTIR/tests/ ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here...
Add resampler docs
Add test phase to the SIRF project.