-
Notifications
You must be signed in to change notification settings - Fork 154
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
Unit testing #24
Comments
yes, we absolutely need this :) I agree that full unit testing of the spec is too much work, and likely unecessary anyway if the conformance test suite will be released. So, let's just add tests for new features/issues as you suggest. There are several components to testing:
Ultimately we are interested in knowing if For tests which contain device code, the most straight-forward approach would be:
Tests which only affect some internals of the runtime (e.g. task graph) should be compiled with I'm not familiar with catch2. My original plan was using |
I'm back with some news on the unit testing front! I tried to evaluate the differences between Catch2 and Boost.Test to see which framework would be better suited for this project. As it turns out they are quite similar regarding their feature set and I didn't encounter anything in either one that I'd miss in the other. Of course the approach to certain things, for example fixtures, is quite different -- but they both support it. Ultimately I think Catch2 is a tad more convenient and succinct to use (which makes sense, as it is newer and makes heavy use of modern C++ features). Unfortunately however, as it turns out, as of right now Clang 8 doesn't seem to like the combination of Catch2 and hipSYCL at all - as it somehow doesn't compile or call device code correctly. I won't go into any details, suffice to say I've spent a good two days trying to figure this out and the problem is just really weird (something I've gotten used to working in this space...). Since everything seems to work with In any case, I've started writing some unit tests using Boost.Test and have been making good progress. I'll open a PR shortly. |
While trying to compile more complex applications I often find areas of hipSYCL where I’d like to contribute something, be it a missing operator on some class or error handling for some particularly obscure situation (into which I tend to run into quite frequently for some reason). Also I’m getting a lot of (mostly minor) compiler warnings with hipSYCL right now, and I’d like to cut down on those as well. Anyway, I’d like to not break the existing implementation while doing this – so I think it’s time to add unit tests :).
While at some point it would be great to have test coverage for all the different components of hipSYCL (i.e. the source transformations,
syclcc
, ...), I think for now the most important thing is to add tests for the C++ library itself.With SYCL being a specification, it certainly could be a good approach to try and add tests by systematically going through the spec. Unfortunately I don’t have the resources to embark on such a journey right now, so I’d suggest to take a more ad-hoc approach for now (i.e., adding tests as new features are added or when bugs are fixed). Once the conformance test suite goes public (#6) things should also become a lot easier in this regard.
A couple of questions of how to approach testing come to mind (I’m sure there’s more to figure out further down the line...):
Do you have any preferences regarding a unit testing framework? I can highly recommend using Catch2, as it's modern, very easy to set up and doesn't get in your way.
Let me know your thoughts on this; I can begin to set this up if you’d like.
PS: Sorry for the issue-avalanche, as I mentioned I had some stuff in my backlog and I figured to just do it all today and be done with it ;-).
The text was updated successfully, but these errors were encountered: