Skip to content
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

Merged
merged 12 commits into from
Sep 27, 2017
Merged

added tests #58

merged 12 commits into from
Sep 27, 2017

Conversation

paskino
Copy link
Contributor

@paskino paskino commented Sep 19, 2017

Add test phase to the SIRF project.

Copy link
Member

@KrisThielemans KrisThielemans left a 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
Copy link
Member

@KrisThielemans KrisThielemans left a 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

@@ -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)
Copy link
Member

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()
Copy link
Member

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)
Copy link
Member

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...

@paskino
Copy link
Contributor Author

paskino commented Sep 20, 2017

I have moved the tests in src/xGadgetron/pGadgetron/tests/CMakeLists.txt and src/xSTIR/pSTIR/tests/CMakeLists.txt

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)
Copy link
Member

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

@KrisThielemans
Copy link
Member

looks good but a few comments remaining.

no clue why it doesn't find the pStir test. sorry.

@paskino
Copy link
Contributor Author

paskino commented Sep 21, 2017

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.
Once this is merged, we may merge the ctest branch on SuperBuild.

@KrisThielemans
Copy link
Member

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.

@KrisThielemans
Copy link
Member

perfect. ready to accept? Prefer a merge or a squash-merge? (see email)

@paskino
Copy link
Contributor Author

paskino commented Sep 21, 2017

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
@KrisThielemans
Copy link
Member

but the same doc says

Enables testing for this directory and below. 

it doesn't make sense to me (and it isn't needed in STIR). @paskino, are you sure we need this?

@KrisThielemans
Copy link
Member

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
@paskino
Copy link
Contributor Author

paskino commented Sep 21, 2017

good to know! I actually struggled to find that variable! All right, I'll fix it next week then.

@KrisThielemans
Copy link
Member

use CMAKE_SOURCE_DIR rather than CMAKE_PREFIX_PATH to set the path to
the test files.
@KrisThielemans KrisThielemans merged commit 42e305f into master Sep 27, 2017
# limitations under the License.
#
#=========================================================================
include(FindPythonInterp)
Copy link
Member

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

Copy link
Contributor Author

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/ )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here...

@KrisThielemans KrisThielemans deleted the ctest branch October 13, 2017 23:02
johannesmayer pushed a commit to johannesmayer/SIRF that referenced this pull request Feb 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants