Skip to content

Commit bce3b50

Browse files
authored
[libc++][Android] Mark tests XFAIL/UNSUPPORTED (#69271)
Mark tests as necessary to accommodate Android L (5.0 / API 21) and up. Add three Android lit features: - android - android-device-api=(21,22,23,...) - LIBCXX-ANDROID-FIXME (for failures that need follow-up work) Enable an AIX workaround in filesystem_test_helper.h for the broken chmod on older Android devices. Mark failing test with XFAIL or UNSUPPORTED: - Mark modules tests as UNSUPPORTED, matching other configurations. - Mark a gdb test as UNSUPPORTED. - XFAIL tests for old devices that lack an API (fmemopen). - XFAIL various FS tests (because SELinux blocks FIFO and hard linking, because fchmodat is broken on old devices). - XFAIL various locale tests (because Bionic has limited locale support). (Also XFAIL an re.traits test.) - XFAIL some print.fun tests because the error exception has no system error string. - Mark std::{cin,wcin} tests UNSUPPORTED because they hang with adb_run.py on old devices. - Mark a few tests UNSUPPORTED because they allocate too much memory. - notify_one.pass.cpp is flaky on Android. - XFAIL libc++abi demangler test because of Android's special long double on x86[-64]. N.B. The `__ANDROID_API__` macro specifies a minimum required API level at build-time, whereas the android-device-api lit feature is the detected API level of the device at run-time. The android-device-api value will be >= `__ANDROID_API__`. This commit was split out from https://reviews.llvm.org/D139147. Fixes: #69270
1 parent eb6ec17 commit bce3b50

File tree

50 files changed

+204
-7
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+204
-7
lines changed

libcxx/test/libcxx/clang_modules_include.gen.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
// UNSUPPORTED{BLOCKLIT}: LIBCXX-AIX-FIXME
3535
3636
// The Android headers don't appear to be compatible with modules yet
37-
// XFAIL{BLOCKLIT}: LIBCXX-ANDROID-FIXME
37+
// UNSUPPORTED{BLOCKLIT}: LIBCXX-ANDROID-FIXME
3838
3939
// TODO: Investigate this failure
4040
// UNSUPPORTED{BLOCKLIT}: LIBCXX-FREEBSD-FIXME
@@ -64,7 +64,7 @@
6464
// UNSUPPORTED{BLOCKLIT}: LIBCXX-AIX-FIXME
6565
6666
// The Android headers don't appear to be compatible with modules yet
67-
// XFAIL{BLOCKLIT}: LIBCXX-ANDROID-FIXME
67+
// UNSUPPORTED{BLOCKLIT}: LIBCXX-ANDROID-FIXME
6868
6969
// TODO: Investigate this failure
7070
// UNSUPPORTED{BLOCKLIT}: LIBCXX-FREEBSD-FIXME

libcxx/test/libcxx/gdb/gdb_pretty_printer_test.sh.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@
1717
// TODO: Investigate this failure on GCC 13 (in Ubuntu Jammy)
1818
// UNSUPPORTED: gcc-13
1919

20+
// The Android libc++ tests are run on a non-Android host, connected to an
21+
// Android device over adb. gdb needs special support to make this work (e.g.
22+
// gdbclient.py, ndk-gdb.py, gdbserver), and the Android organization doesn't
23+
// support gdb anymore, favoring lldb instead.
24+
// UNSUPPORTED: android
25+
2026
// RUN: %{cxx} %{flags} %s -o %t.exe %{compile_flags} -g %{link_flags}
2127
// Ensure locale-independence for unicode tests.
2228
// RUN: env LANG=en_US.UTF-8 %{gdb} -nx -batch -iex "set autoload off" -ex "source %S/../../../utils/gdb/libcxx/printers.py" -ex "python register_libcxx_printer_loader()" -ex "source %S/gdb_pretty_printer_test.py" %t.exe

libcxx/test/libcxx/input.output/iostream.format/print.fun/vprint_unicode_posix.pass.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111

1212
// XFAIL: availability-fp_to_chars-missing
1313

14+
// fmemopen is available starting in Android M (API 23)
15+
// XFAIL: target={{.+}}-android{{(eabi)?(21|22)}}
16+
1417
// REQUIRES: has-unix-headers
1518

1619
// <print>

libcxx/test/std/input.output/file.streams/fstreams/filebuf.members/close.pass.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010

1111
// basic_filebuf<charT,traits>* close();
1212

13+
// This test closes an fd that belongs to a std::filebuf, and Bionic's fdsan
14+
// detects this and aborts the process, starting in Android R (API 30).
15+
// See D137129.
16+
// XFAIL: LIBCXX-ANDROID-FIXME && !android-device-api={{2[1-9]}}
17+
1318
#include <fstream>
1419
#include <cassert>
1520
#if defined(__unix__)

libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/file_size.pass.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
// against already-released libc++'s.
1313
// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx{{10.15|11.0}}
1414

15+
// Starting in Android N (API 24), SELinux policy prevents the shell user from
16+
// creating a FIFO file.
17+
// XFAIL: LIBCXX-ANDROID-FIXME && !android-device-api={{21|22|23}}
18+
1519
// <filesystem>
1620

1721
// class directory_entry

libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/file_type_obs.pass.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88

99
// UNSUPPORTED: c++03
1010

11+
// Starting in Android N (API 24), SELinux policy prevents the shell user from
12+
// creating a hard link.
13+
// XFAIL: LIBCXX-ANDROID-FIXME && !android-device-api={{21|22|23}}
14+
1115
// <filesystem>
1216

1317
// class directory_entry

libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/hard_link_count.pass.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
// against already-released libc++'s.
1313
// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx{{10.15|11.0}}
1414

15+
// Starting in Android N (API 24), SELinux policy prevents the shell user from
16+
// creating a hard link.
17+
// XFAIL: LIBCXX-ANDROID-FIXME && !android-device-api={{21|22|23}}
18+
1519
// <filesystem>
1620

1721
// class directory_entry

libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/increment.pass.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
// UNSUPPORTED: no-filesystem
1111
// UNSUPPORTED: availability-filesystem-missing
1212

13+
// On Android L, ~scoped_test_env() is unable to delete the temp dir using
14+
// chmod+rm because chmod is too broken.
15+
// XFAIL: LIBCXX-ANDROID-FIXME && android-device-api={{21|22}}
16+
1317
// <filesystem>
1418

1519
// class recursive_directory_iterator

libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy/copy.pass.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
// UNSUPPORTED: no-filesystem
1111
// UNSUPPORTED: availability-filesystem-missing
1212

13+
// Starting in Android N (API 24), SELinux policy prevents the shell user from
14+
// creating a FIFO file.
15+
// XFAIL: LIBCXX-ANDROID-FIXME && !android-device-api={{21|22|23}}
16+
1317
// <filesystem>
1418

1519
// void copy(const path& from, const path& to);

libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy_file/copy_file.pass.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
// against already-released libc++'s.
1515
// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx{{10.15|11.0}}
1616

17+
// Starting in Android N (API 24), SELinux policy prevents the shell user from
18+
// creating a FIFO file.
19+
// XFAIL: LIBCXX-ANDROID-FIXME && !android-device-api={{21|22|23}}
20+
1721
// <filesystem>
1822

1923
// bool copy_file(const path& from, const path& to);

0 commit comments

Comments
 (0)