[libcxx-commits] [PATCH] D117993: [libc++][RFC] Guard against libc++ macros in tests.

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Jan 23 09:37:30 PST 2022


Mordante created this revision.
Mordante added reviewers: ldionne, Quuxplusone.
Mordante requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

D117992 <https://reviews.llvm.org/D117992> removed an libc++ specific macro in our tests. This example lit
tests guards against reintroducing this macro in future commits.

Is there an interest in a script like this? If so I'll look at the other
libc++ macros we want to guard against.

Do we want to guard both `test/std` and `test/libcxx` or only the
former?  (The latter is already libc++ specific, but using the TEST
macros there seems good practice.) Currently the script only tests for
`test/std`.

NOTE the test should fail since we don't depend on D117992 <https://reviews.llvm.org/D117992>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D117993

Files:
  libcxx/test/libcxx/lint/lint_foo.sh.cpp


Index: libcxx/test/libcxx/lint/lint_foo.sh.cpp
===================================================================
--- /dev/null
+++ libcxx/test/libcxx/lint/lint_foo.sh.cpp
@@ -0,0 +1,16 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// Tests in the test/std should work with all Standard library implementations.
+// This test greps for the usage of some libc++ internal defines that have a
+// TEST macro that achieves the same in a portable fashion.
+//
+// Upon failure the found results are part of the test's failure output. This
+// makes finding the occurrences easy.
+
+RUN: not grep -R _LIBCPP_HAS_NO_INT128 %S/../../std


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117993.402346.patch
Type: text/x-patch
Size: 966 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220123/52af4878/attachment.bin>


More information about the libcxx-commits mailing list