This is an archive of the discontinued LLVM Phabricator instance.

[libc++][test] Skip string_view tests for other vendors on older modes
ClosedPublic

Authored by jloser on Jun 1 2022, 8:34 PM.

Details

Summary

string_view is supported all the way back to C++03 as an extension in
libc++, and so many of the tests run in all standards modes for all vendors.
This is unlikely desired by other standard library vendors using our test suite.
So, disable the tests for vendors other than libc++ in these older standards
modes.

Diff Detail

Event Timeline

jloser created this revision.Jun 1 2022, 8:34 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 1 2022, 8:34 PM
Herald added a subscriber: arphaman. · View Herald Transcript
jloser requested review of this revision.Jun 1 2022, 8:34 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 1 2022, 8:34 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
jloser updated this revision to Diff 433637.Jun 1 2022, 8:36 PM

Simplify the // UNSUPPORTED clauses in the literal tests

philnik accepted this revision as: philnik.Jun 2 2022, 12:43 AM

LGTM, but I'd like to wait for a second reviewer.

Thanks for the cleanup! There are several minor issues.

libcxx/test/std/strings/string.view/string.view.cons/from_iterator_sentinel.pass.cpp
15

This isn't needed, see line 8.

libcxx/test/std/strings/string.view/string.view.cons/from_range.pass.cpp
16

This isn't needed, see line 8.

libcxx/test/std/strings/string.view/string.view.hash/string_view.pass.cpp
18

Can you move this more to the top, (before // <functional>) of the file like we do in the other tests?

Same for other places.

libcxx/test/std/strings/string.view/string.view.template/ends_with.ptr.pass.cpp
31

Is this intended? It adds new unused variables.

(This file contains a similar commented out block at line 71.)

The same for the next file.

jloser updated this revision to Diff 433839.Jun 2 2022, 12:30 PM
jloser marked 3 inline comments as done.

Fix placement of // UNSUPPORTED and Mordante's comments

jloser marked an inline comment as done.Jun 2 2022, 12:30 PM
jloser added inline comments.
libcxx/test/std/strings/string.view/string.view.hash/string_view.pass.cpp
18

Done! Good spot.

libcxx/test/std/strings/string.view/string.view.template/ends_with.ptr.pass.cpp
31

Sorry, this was done in a separate PR (https://github.com/llvm/llvm-project/commit/6423a9f0ec8ba70049ea76e7bcfc9a9d1a54e826) and was wrong to begin with. It is fixed with https://reviews.llvm.org/D126901

Mordante accepted this revision.Jun 3 2022, 11:44 AM

There are a few places where the UNSUPPORTED isn't in the proper spot, I've marked all of them. Please update these before landing this patch.
Other than these nits, LGTM.

libcxx/test/std/strings/string.view/char.bad.fail.cpp
12

Please move up.

libcxx/test/std/strings/string.view/string.view.access/front.pass.cpp
13

Please move up.

libcxx/test/std/strings/string.view/string.view.find/find_last_not_of_string_view_size.pass.cpp
13

Please move up.

This revision is now accepted and ready to land.Jun 3 2022, 11:44 AM