[libcxx-commits] [libcxx] 8dcb8ea - [libc++] Remove support for .fail.cpp tests
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Jul 3 12:38:49 PDT 2023
Author: Louis Dionne
Date: 2023-07-03T15:38:37-04:00
New Revision: 8dcb8ea75ceff06205740ffad3fcce1fa19f353e
URL: https://github.com/llvm/llvm-project/commit/8dcb8ea75ceff06205740ffad3fcce1fa19f353e
DIFF: https://github.com/llvm/llvm-project/commit/8dcb8ea75ceff06205740ffad3fcce1fa19f353e.diff
LOG: [libc++] Remove support for .fail.cpp tests
We want to move away from those tests and towards explicit .verify.cpp
tests, since those have a simpler model.
Differential Revision: https://reviews.llvm.org/D153982
Added:
Modified:
libcxx/utils/libcxx/test/format.py
Removed:
libcxx/test/libcxx/selftest/fail.cpp/compile-failure.fail.cpp
libcxx/test/libcxx/selftest/fail.cpp/compile-success.fail.cpp
libcxx/test/libcxx/selftest/fail.cpp/no-diagnostics-unmarked.fail.cpp
libcxx/test/libcxx/selftest/fail.cpp/no-diagnostics.fail.cpp
libcxx/test/libcxx/selftest/fail.cpp/right-diagnostic.fail.cpp
libcxx/test/libcxx/selftest/fail.cpp/wrong-diagnostic.fail.cpp
################################################################################
diff --git a/libcxx/test/libcxx/selftest/fail.cpp/compile-failure.fail.cpp b/libcxx/test/libcxx/selftest/fail.cpp/compile-failure.fail.cpp
deleted file mode 100644
index 245ade41cdf67b..00000000000000
--- a/libcxx/test/libcxx/selftest/fail.cpp/compile-failure.fail.cpp
+++ /dev/null
@@ -1,15 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
-// Make sure the test passes if we don't have clang-verify support and
-// the test fails to compile.
-
-// UNSUPPORTED: verify-support
-
-struct Foo { };
-typedef Foo::x x;
diff --git a/libcxx/test/libcxx/selftest/fail.cpp/compile-success.fail.cpp b/libcxx/test/libcxx/selftest/fail.cpp/compile-success.fail.cpp
deleted file mode 100644
index e47efc6d01df61..00000000000000
--- a/libcxx/test/libcxx/selftest/fail.cpp/compile-success.fail.cpp
+++ /dev/null
@@ -1,16 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
-// XFAIL: *
-
-// Make sure the test DOES NOT pass if we don't have clang-verify support and
-// the test compiles successfully.
-
-// UNSUPPORTED: verify-support
-
-int main(int, char**) { return 0; }
diff --git a/libcxx/test/libcxx/selftest/fail.cpp/no-diagnostics-unmarked.fail.cpp b/libcxx/test/libcxx/selftest/fail.cpp/no-diagnostics-unmarked.fail.cpp
deleted file mode 100644
index 683a9c7fa7db0a..00000000000000
--- a/libcxx/test/libcxx/selftest/fail.cpp/no-diagnostics-unmarked.fail.cpp
+++ /dev/null
@@ -1,19 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
-// REQUIRES: verify-support
-
-// XFAIL: *
-
-// Make sure the test DOES NOT pass if there are no diagnostics, but we didn't
-// use the 'expected-no-diagnostics' markup.
-//
-// Note: For the purpose of this test, make sure the file would otherwise
-// compile to make sure we really fail due to a lack of markup.
-
-int main(int, char**) { return 0; }
diff --git a/libcxx/test/libcxx/selftest/fail.cpp/no-diagnostics.fail.cpp b/libcxx/test/libcxx/selftest/fail.cpp/no-diagnostics.fail.cpp
deleted file mode 100644
index 8172961003754c..00000000000000
--- a/libcxx/test/libcxx/selftest/fail.cpp/no-diagnostics.fail.cpp
+++ /dev/null
@@ -1,14 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
-// REQUIRES: verify-support
-
-// Make sure the test passes if we expected no diagnostics and included
-// the markup.
-
-// expected-no-diagnostics
diff --git a/libcxx/test/libcxx/selftest/fail.cpp/right-diagnostic.fail.cpp b/libcxx/test/libcxx/selftest/fail.cpp/right-diagnostic.fail.cpp
deleted file mode 100644
index 4d428813a118d3..00000000000000
--- a/libcxx/test/libcxx/selftest/fail.cpp/right-diagnostic.fail.cpp
+++ /dev/null
@@ -1,17 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
-// REQUIRES: verify-support
-
-// Make sure the test passes if it fails at compile-time with the expected
-// diagnostic.
-
-struct Foo { };
-typedef Foo::x x; // expected-error{{no type named 'x' in 'Foo'}}
-
-int main(int, char**) { return 0; }
diff --git a/libcxx/test/libcxx/selftest/fail.cpp/wrong-diagnostic.fail.cpp b/libcxx/test/libcxx/selftest/fail.cpp/wrong-diagnostic.fail.cpp
deleted file mode 100644
index f10623054a93c7..00000000000000
--- a/libcxx/test/libcxx/selftest/fail.cpp/wrong-diagnostic.fail.cpp
+++ /dev/null
@@ -1,18 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
-// REQUIRES: verify-support
-
-// XFAIL: *
-
-// Make sure the test DOES NOT pass if the expected diagnostic is wrong.
-
-struct Foo { };
-typedef Foo::x x; // expected-error{{this is not found in the errors}}
-
-int main(int, char**) { return 0; }
diff --git a/libcxx/utils/libcxx/test/format.py b/libcxx/utils/libcxx/test/format.py
index 13e40738d30ae6..ddd88f25646eaa 100644
--- a/libcxx/utils/libcxx/test/format.py
+++ b/libcxx/utils/libcxx/test/format.py
@@ -218,11 +218,6 @@ class CxxStandardLibraryTest(lit.formats.FileBasedTest):
automatically marked as UNSUPPORTED if the compiler
does not support Clang-verify.
- FOO.fail.cpp - Compiled with clang-verify if clang-verify is
- supported, and equivalent to a .compile.fail.cpp
- test otherwise. This is supported only for backwards
- compatibility with the test suite.
-
Substitution requirements
===============================
@@ -367,21 +362,6 @@ def execute(self, test, litConfig):
"%dbg(EXECUTED AS) %{exec} %t.exe",
]
return self._executeShTest(test, litConfig, steps)
- # This is like a .verify.cpp test when clang-verify is supported,
- # otherwise it's like a .compile.fail.cpp test. This is only provided
- # for backwards compatibility with the test suite.
- elif filename.endswith(".fail.cpp"):
- if supportsVerify:
- steps = [
- "%dbg(COMPILED WITH) %{{cxx}} %s %{{flags}} %{{compile_flags}} -fsyntax-only -Wno-error {}".format(
- VERIFY_FLAGS
- )
- ]
- else:
- steps = [
- "%dbg(COMPILED WITH) ! %{cxx} %s %{flags} %{compile_flags} -fsyntax-only"
- ]
- return self._executeShTest(test, litConfig, steps)
else:
return lit.Test.Result(
lit.Test.UNRESOLVED, "Unknown test suffix for '{}'".format(filename)
More information about the libcxx-commits
mailing list