-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Various improvements of test suite before addition of <flat_meow>.
#5968
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
base: main
Are you sure you want to change the base?
Conversation
… feature test macro.
…cros and _HAS_CXX2a
| @@ -0,0 +1,20 @@ | ||
| // Copyright (c) Microsoft Corporation. |
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 think we should drop this file at this moment. It should be added when implementing inplace_vector.
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.
Although I have created a soft link by mentioning the relevant issues, I think relying on authors of inplace_vector, hive or optional range accessors to update this test in the future is a completely redundant mental burden and waste of time.
I like the current solution since it tests the current WP's requirements completely and will continue to do so until a new container is added. I personally see no issue in testing "future technology" when it is properly guarded with feature test macros. I consider this in line with their intended use case. Especially in this case, where I don't speculatively test some unstable API.
| #include <version> | ||
| #if defined(__cpp_lib_hive) && _HAS_CXX26 | ||
|
|
||
| #include <hive> |
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.
Ditto, this file should be added when implementing hive.
| tests\LWG3545_pointer_traits_sfinae | ||
| tests\LWG3561_discard_block_engine_counter | ||
| tests\LWG3610_iota_view_size_and_integer_class | ||
| tests\LWG3987_including_flat_foo_doesnt_provide_begin_end |
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 don't think LWG3987_including_flat_foo_doesnt_provide_begin_end is a good name for these tests. As availability of begin/end in many headers is required since C++11 via WG21-N2930.
But since N2930 is too old, I guess it's a bit unconventional to mention it in the test name.
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.
Also, we generally don't mention "foo" in the repo, even if the LWG issue title says it.
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.
Also, we generally don't mention "foo" in the repo, even if the LWG issue title says it.
I don't mean to disagree, but can you elaborate a little? Yes, I have noticed you prefer meow over foo, but as far as I am aware, both are perfectly valid placeholders with no cultural, religious or any different negative connotation.
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 don't think
LWG3987_including_flat_foo_doesnt_provide_begin_endis a good name for these tests. As availability ofbegin/endin many headers is required since C++11 via WG21-N2930. But since N2930 is too old, I guess it's a bit unconventional to mention it in the test name.
Oh yes, I agree, but I found no precedent for naming a test that is not strictly related to any paper (Pxxx, LWGxxx) or issue (GH, and I assume VSO and Dev fall into this category too).
I'll gladly rename this to (some-prefix)_include_iterator_range, but regarding "some-prefix", I would need to use this PR as GH_005968 or created a completely new prefix, e.g. MISC for unsorted miscellaneous tests.
I prefer the MISC prefix, but it is your call.
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.
There was an old policy on MSDN where they avoided "foo" because it was part of "foobar" and people were concerned that sounded like something else. Really silly but we've continued to avoid "foo".
We used to use VSO_0000000 for novel tests but that was clutter-inducing so we stopped. Marking this as GH with the PR number is useful context, I recommend that.
| // Copyright (c) Microsoft Corporation. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
|
|
||
| #include <version> |
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 think we should either avoid including any header, or include <version> and then guard tests with _HAS_CXXNN.
| void test_forward_list(); | ||
| void test_hive(); | ||
| void test_inplace_vector(); | ||
| void test_list(); |
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.
test_iterator() seems missing.
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
|
|
||
| #include <version> | ||
| #if defined(__cpp_lib_optional_range_support) && _HAS_CXX17 |
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 believe __cpp_lib_optional_range_support won't be defined in pre-C++26 modes. Perhaps we should also drop this file at this moment.
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 believe
__cpp_lib_optional_range_supportwon't be defined in pre-C++26 modes. Perhaps we should also drop this file at this moment.
I only skimmed through yvals_core.h and - clearly incorrectly - concluded that we define all __cpp_lib_xxx unconditionally as soon as a feature is implemented. So I will drop all _HAS_CXX_2a and keep just the feature test macro.
|
Draft mode just disables CI runs. Was that your intention? |
Today I learned :D |
|
Thanks, I'll move it to WIP for you. When you're ready to run tests, mark it ready for review (moving it out of draft status) and then push commits, which will trigger CI. Merely moving out of draft mode does not start tests. |
This PR is a collection of changes that are remotely related to work on
<flat_meow>, but they are sufficiently self-contained that it would be nice to introduce them separately, before the feature branch is merged.Changes:
LWG3987_including_flat_foo_doesnt_provide_begin_endfor requirements of [iterator.range]/1 that certain headers introduce free functionsbegin/end/data/sizeetc. This test is required to prove proper implementation of LWG-3987 "Including<flat_foo>doesn't providestd::begin/end". Structure inspired byGH_000545_include_compare. Some notes:<valarray>test is deactivated with// TRANSITIONas it is blocked by Implement P3016R6 Resolve Inconsistencies Inbegin/endForvalarrayAnd Braced Initializer Lists #5847 (expected to accept soon)<flat_map>,<flat_set>,<optional>,<hive>and<inplace_vector>tests guarded by corresponding feature test macros; they will be activated by resolving P0429R9<flat_map>#2910, P1222R4<flat_set>#2912, P3168R2std::optionalRange Support #4772, P0447R28<hive>#5301 and P0843R14<inplace_vector>#4766, respectively.