[libcxx-commits] [libcxx] d58107c - [libc++] Remove support for .fail.mm tests

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Tue Apr 14 09:21:44 PDT 2020


Author: Louis Dionne
Date: 2020-04-14T12:20:23-04:00
New Revision: d58107c3bf6b5437c13a4dee3b90a7fe80cf4205

URL: https://github.com/llvm/llvm-project/commit/d58107c3bf6b5437c13a4dee3b90a7fe80cf4205
DIFF: https://github.com/llvm/llvm-project/commit/d58107c3bf6b5437c13a4dee3b90a7fe80cf4205.diff

LOG: [libc++] Remove support for .fail.mm tests

There are no such tests in the libc++ test suite, and I want to move
away from `.fail.cpp` tests (in favour of something else) too, which
require a workaround.

Added: 
    

Modified: 
    libcxx/utils/libcxx/test/format.py
    libcxx/utils/libcxx/test/newformat.py

Removed: 
    libcxx/test/libcxx/selftest/newformat/fail.mm/compile-error-with-verify.fail.mm
    libcxx/test/libcxx/selftest/newformat/fail.mm/compile-error-without-verify.fail.mm
    libcxx/test/libcxx/selftest/newformat/fail.mm/compile-success.fail.mm
    libcxx/test/libcxx/selftest/newformat/fail.mm/wrong-expected.fail.cpp
    libcxx/test/libcxx/selftest/test.arc.fail.mm
    libcxx/test/libcxx/selftest/test.fail.mm


################################################################################
diff  --git a/libcxx/test/libcxx/selftest/newformat/fail.mm/compile-error-with-verify.fail.mm b/libcxx/test/libcxx/selftest/newformat/fail.mm/compile-error-with-verify.fail.mm
deleted file mode 100644
index a45f05e3a925..000000000000
--- a/libcxx/test/libcxx/selftest/newformat/fail.mm/compile-error-with-verify.fail.mm
+++ /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
-//
-//===----------------------------------------------------------------------===//
-
-// REQUIRES: objective-c++
-
-// Make sure the test passes if it fails at compile-time, with verify
-
-struct Foo { };
-typedef Foo::x x; // expected-error{{no type named 'x' in 'Foo'}}
-
-int main() { }

diff  --git a/libcxx/test/libcxx/selftest/newformat/fail.mm/compile-error-without-verify.fail.mm b/libcxx/test/libcxx/selftest/newformat/fail.mm/compile-error-without-verify.fail.mm
deleted file mode 100644
index 57edb18c7073..000000000000
--- a/libcxx/test/libcxx/selftest/newformat/fail.mm/compile-error-without-verify.fail.mm
+++ /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
-//
-//===----------------------------------------------------------------------===//
-
-// REQUIRES: objective-c++
-
-// Make sure the test passes if it fails at compile-time, without verify
-
-struct Foo { };
-typedef Foo::x x;
-
-int main() { }

diff  --git a/libcxx/test/libcxx/selftest/newformat/fail.mm/compile-success.fail.mm b/libcxx/test/libcxx/selftest/newformat/fail.mm/compile-success.fail.mm
deleted file mode 100644
index a802d9cb1252..000000000000
--- a/libcxx/test/libcxx/selftest/newformat/fail.mm/compile-success.fail.mm
+++ /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
-//
-//===----------------------------------------------------------------------===//
-
-// REQUIRES: objective-c++
-
-// XFAIL: *
-
-// Make sure the test DOES NOT pass if it succeeds at compile-time
-
-int main() { }

diff  --git a/libcxx/test/libcxx/selftest/newformat/fail.mm/wrong-expected.fail.cpp b/libcxx/test/libcxx/selftest/newformat/fail.mm/wrong-expected.fail.cpp
deleted file mode 100644
index d0f0f9344e37..000000000000
--- a/libcxx/test/libcxx/selftest/newformat/fail.mm/wrong-expected.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: objective-c++
-
-// XFAIL: *
-
-// Make sure the test DOES NOT pass if it fails at compile-time, but the
-// expected-error is wrong.
-
-struct Foo { };
-typedef Foo::x x; // expected-error{{this is not found in the errors}}
-
-int main() { }

diff  --git a/libcxx/test/libcxx/selftest/test.arc.fail.mm b/libcxx/test/libcxx/selftest/test.arc.fail.mm
deleted file mode 100644
index 0e8b62c09db5..000000000000
--- a/libcxx/test/libcxx/selftest/test.arc.fail.mm
+++ /dev/null
@@ -1,14 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
-// ADDITIONAL_COMPILE_FLAGS: -fobjc-arc
-
-#if __has_feature(objc_arc)
-#error This test should not compile.
-#endif

diff  --git a/libcxx/test/libcxx/selftest/test.fail.mm b/libcxx/test/libcxx/selftest/test.fail.mm
deleted file mode 100644
index ea3a05421f14..000000000000
--- a/libcxx/test/libcxx/selftest/test.fail.mm
+++ /dev/null
@@ -1,12 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
-#if __has_feature(objc_arc) == 0
-#error This test should not compile.
-#endif

diff  --git a/libcxx/utils/libcxx/test/format.py b/libcxx/utils/libcxx/test/format.py
index 0316835dd275..0ec68e9716ad 100644
--- a/libcxx/utils/libcxx/test/format.py
+++ b/libcxx/utils/libcxx/test/format.py
@@ -95,7 +95,7 @@ def _execute(self, test, lit_config):
         is_libcxx_test = test.path_in_suite[0] == 'libcxx'
         is_sh_test = name_root.endswith('.sh')
         is_pass_test = name.endswith('.pass.cpp') or name.endswith('.pass.mm')
-        is_fail_test = name.endswith('.fail.cpp') or name.endswith('.fail.mm')
+        is_fail_test = name.endswith('.fail.cpp')
         is_objcxx_test = name.endswith('.mm')
         assert is_sh_test or name_ext == '.cpp' or name_ext == '.mm', \
             'non-cpp file must be sh test'

diff  --git a/libcxx/utils/libcxx/test/newformat.py b/libcxx/utils/libcxx/test/newformat.py
index f1518df6e5d0..88aa29fbb2d5 100644
--- a/libcxx/utils/libcxx/test/newformat.py
+++ b/libcxx/utils/libcxx/test/newformat.py
@@ -22,11 +22,14 @@ class CxxStandardLibraryTest(lit.formats.TestFormat):
     FOO.pass.cpp            - Compiles, links and runs successfully
     FOO.pass.mm             - Same as .pass.cpp, but for Objective-C++
     FOO.run.fail.cpp        - Compiles and links successfully, but fails at runtime
+
     FOO.compile.pass.cpp    - Compiles successfully, link and run not attempted
     FOO.compile.fail.cpp    - Does not compile successfully. These tests run with
                               clang-verify.
+
     FOO.link.pass.cpp       - Compiles and links successfully, run not attempted
     FOO.link.fail.cpp       - Compiles successfully, but fails to link
+
     FOO.sh.cpp              - A builtin lit Shell test
     FOO.sh.s                - A builtin lit Shell test
 
@@ -34,7 +37,6 @@ class CxxStandardLibraryTest(lit.formats.TestFormat):
                               if any expected-meow appears in the file, otherwise
                               just test that compilation fails. This is supported
                               only for backwards compatibility with the test suite
-    FOO.fail.mm             - Same as .fail.cpp, but for Objective-C++
 
     The test format operates by assuming that each test's configuration provides
     the following substitutions, which it will reuse in the shell scripts it
@@ -89,7 +91,7 @@ def getTestsInDirectory(self, testSuite, pathInSuite, litConfig, localConfig):
                               '.compile.pass.cpp', '.compile.fail.cpp',
                               '.link.pass.cpp', '.link.fail.cpp',
                               '.sh.cpp', '.sh.s',
-                              '.fail.cpp', '.fail.mm']
+                              '.fail.cpp']
         sourcePath = testSuite.getSourcePath(pathInSuite)
         for filename in os.listdir(sourcePath):
             # Ignore dot files and excluded tests.
@@ -184,7 +186,7 @@ def execute(self, test, litConfig):
             return self._executeShTest(test, litConfig, steps, fileDependencies=['%t.exe'])
         # This is the same as .compile.fail.cpp, provided for backwards
         # compatibility with the test suite.
-        elif filename.endswith('.fail.cpp') or filename.endswith('.fail.mm'):
+        elif filename.endswith('.fail.cpp'):
             if self._useVerify(test, litConfig):
                 steps = [
                     "%dbg(COMPILED WITH) %{cxx} %s %{flags} %{compile_flags} -fsyntax-only " + VERIFY_FLAGS


        


More information about the libcxx-commits mailing list