-
Notifications
You must be signed in to change notification settings - Fork 58
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
use C++ for unit tests #646
base: master
Are you sure you want to change the base?
Conversation
603dc15
to
4ac7d2b
Compare
I had comments on some of the early patches in this PR from other PRs, so dont' feel comfortable approving the PR. That said, the last commit (the uniq one across your PRs) looks good to me. |
3e2ca3b
to
6f2180b
Compare
6dfbcec
to
5243aa5
Compare
5243aa5
to
3efef5c
Compare
g++7 fails to initialize C-style tagged unions with the following error message: > sorry, unimplemented: non-trivial designated initializers not > supported Note that gcc7 handles this fine when the file is parsed as C, as well as g++8 and beyond, and the problem only exists when operating in C++ mode under g++7. AL2 is still using this ancient toolchain, so add a hack in the case that it is used. This is pretty horrible, and should be cleaned up sooner rather than later. Signed-off-by: Nicholas Sielicki <[email protected]>
bad74fc re-triggered -Wnarrowing on rebase. The natural type of the array rvalue here is size_t[] because it's defined in terms of the stripe size, and the stripe size array is size_t[]. The entire rval is then implicitly converted to int[] through assignment, which causes narrowing. Offsets here should just be size_t in the first place, though, as it's what the uut is expecting. Signed-off-by: Nicholas Sielicki <[email protected]>
On builds where lttng is enabled, the inclusion of nccl_ofi_tracepoint.h pulls in <lttng/ust-utils.h>, which defines templates when __cplusplus is defined without restraint. Those templates cannot have C linkage. This file does not really need nccl_ofi_tracepoint.h; it only needs config.h to test for whether NVTX tracing is enabled, and then it needs nvtx3 headers in the case that it is so that it may define storage for the nvtx domain handles. Signed-off-by: Nicholas Sielicki <[email protected]>
Signed-off-by: Nicholas Sielicki <[email protected]>
All included headers are fully safe to be parsed as C++, so these unit tests can now use C++. Rename them to `.cc' files and use a few c++ keywords to enforce that the compiler is actually treating them as such. Actual C++ cleanups to follow later, hopefully alongside a unit test framework like gtest or catch2. Signed-off-by: Nicholas Sielicki <[email protected]>
3efef5c
to
eb32d6b
Compare
I'm confused that #733 has the same commits as this PR, but that one is passing GitHub workflows and this one is not. |
looks like you forgot to update the endpoint hash table unit test. |
The offending unit test was removed in that patch series. |
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.