-
Notifications
You must be signed in to change notification settings - Fork 86
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
Add CTest support #310
Add CTest support #310
Conversation
Compilers other than the Intel compiler also do not like some flags. So it is better to whitelist rather than blacklist.
We need to set the CC/CXX environment variables to pick up newer GCC/Clang (and not the system GCC) anyway, so make this consistent for the Intel compiler as well (CC=icc CXX=icpc).
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 left a few comments but overall it looks pretty good! Thanks for heavily updating the CMake build!
Thanks for the quick review. I'll get on the requested changes today. |
Add all tests currently called from the run_* scripts in the tests directory to CMake, so they can be built automatically and run using 'ctest' in the build directory. Set ENABLE_TESTS=ON to enable this. This also changes some paths so that all build artefacts end up inside the build directory, and no longer pollute the source tree.
There is now a CMakeLists.txt, so one more file in the directory.
PWD is not always the same as current working directory. This is a problem when calling tests from ctest: the working directory is changed, but the value of env::PWD is then incorrect. Kernel files are then not found. Using this system call the directory is correctly returned.
Some tests override the OCCA_CACHE_DIR environment variable. This leads to artefacts (e.g. lock files) in the source tree instead of the build tree. In this way we let CMake take care of the correct paths.
Clang also defines __GNUC__, so it would be incorrectly identified as GNU before reaching the check for __clang__.
I've addressed your concerns I hope and merged the changes into the relevant commits. Currently running tests locally before updating this PR. Could the Travis pipeline be expanded in the future to also test the CMake/CTest path? |
Updated my branch; works on my end :) |
@SFrijters Awesome, thanks for the quick fixes! I'll try running the tests tonight and merge if they pass. Not sure why Travis didn't run them for this PR :( |
Description
Attempts to close #309 .
This also includes some general improvements to the CMake files, and some fixes that were exposed during the implementation and testing of the CTest.
One bugfix that may need discussion in particular is db7e8e4.
Please let me know if you want me to split things up differently.
EDIT: updated commit hash after rebase