[libcxx-commits] [PATCH] D139147: [libc++][Android] Enable libc++ testing on Android

Ryan Prichard via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Oct 10 01:30:34 PDT 2023


rprichard updated this revision to Diff 557663.
rprichard added a comment.

Use `stdin=subprocess.DEVNULL` for adb_run.py subprocesses, except for the main `adb shell` invocation where we want to forward stdin. This change was necessary to fix stdin forwarding on a Pixel 6 (oriole) device. (However, the API 33 emulator tests passed even without this change. Not sure why.)

Disable three stdin tests on pre-shell_v2 devices for now:

- libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cin.sh.cpp
- libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcin-imbue.sh.cpp
- libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcin.sh.cpp

The tests pass on shell_v2 devices. I _think_ that happens because `adb shell <command>` uses a pipe for stdin, and this pipe is closed on the device when `echo` closes the pipe on the host. Closing stdin signals to the test program to stop waiting for more input.

With pre-shell_v2 devices, the test hangs. Pre-shell_v2 devices always allocate a pty, even for `adb shell <command>`. It appears that the pty is in line editing mode, so it's necessary to send a newline or carriage-return after the `1234` to propagate the line of input into the test program's stdin. Maybe there's some way to fix stdin forwarding in adb_run.py, (e.g. by reading chunks of input in adb_run.py, framing them, then passing each frame through the pty to some shell code on the device that unframes the input and forwards it to the test program via a pipe).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139147/new/

https://reviews.llvm.org/D139147

Files:
  libcxx/cmake/caches/AndroidNDK.cmake
  libcxx/docs/index.rst
  libcxx/test/configs/llvm-libc++-android-ndk.cfg.in
  libcxx/test/libcxx/clang_modules_include.gen.py
  libcxx/test/libcxx/gdb/gdb_pretty_printer_test.sh.cpp
  libcxx/test/libcxx/input.output/iostream.format/print.fun/vprint_unicode_posix.pass.cpp
  libcxx/test/std/input.output/file.streams/fstreams/filebuf.members/close.pass.cpp
  libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/file_size.pass.cpp
  libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/file_type_obs.pass.cpp
  libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/hard_link_count.pass.cpp
  libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/increment.pass.cpp
  libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy/copy.pass.cpp
  libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy_file/copy_file.pass.cpp
  libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_hard_link/create_hard_link.pass.cpp
  libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.equivalent/equivalent.pass.cpp
  libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.hard_lk_ct/hard_link_count.pass.cpp
  libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_empty/is_empty.pass.cpp
  libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.permissions/permissions.pass.cpp
  libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.status/status.pass.cpp
  libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.symlink_status/symlink_status.pass.cpp
  libcxx/test/std/input.output/iostream.format/ext.manip/get_money.pass.cpp
  libcxx/test/std/input.output/iostream.format/ext.manip/put_money.pass.cpp
  libcxx/test/std/input.output/iostream.format/print.fun/no_file_description.pass.cpp
  libcxx/test/std/input.output/iostream.format/print.fun/print.file.pass.cpp
  libcxx/test/std/input.output/iostream.format/print.fun/println.file.pass.cpp
  libcxx/test/std/input.output/iostream.format/print.fun/vprint_nonunicode.file.pass.cpp
  libcxx/test/std/input.output/iostream.format/print.fun/vprint_unicode.file.pass.cpp
  libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cin.sh.cpp
  libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcin-imbue.sh.cpp
  libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcin.sh.cpp
  libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.put.area/pbump2gig.pass.cpp
  libcxx/test/std/input.output/string.streams/stringstream/stringstream.members/gcount.pass.cpp
  libcxx/test/std/localization/locale.categories/category.collate/locale.collate.byname/compare.pass.cpp
  libcxx/test/std/localization/locale.categories/category.collate/locale.collate.byname/transform.pass.cpp
  libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/is_1.pass.cpp
  libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/is_many.pass.cpp
  libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/scan_is.pass.cpp
  libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/scan_not.pass.cpp
  libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp
  libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp
  libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp
  libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp
  libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_en_US.pass.cpp
  libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_string_en_US.pass.cpp
  libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_en_US.pass.cpp
  libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_string_en_US.pass.cpp
  libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long_double.pass.cpp
  libcxx/test/std/re/re.traits/translate_nocase.pass.cpp
  libcxx/test/std/thread/thread.condition/thread.condition.condvar/notify_one.pass.cpp
  libcxx/test/std/utilities/format/format.functions/locale-specific_form.pass.cpp
  libcxx/test/support/filesystem_test_helper.h
  libcxx/utils/adb_run.py
  libcxx/utils/ci/BOT_OWNERS.txt
  libcxx/utils/ci/buildkite-pipeline.yml
  libcxx/utils/ci/run-buildbot
  libcxx/utils/ci/vendor/android/Dockerfile.emulator
  libcxx/utils/ci/vendor/android/build-emulator-images.sh
  libcxx/utils/ci/vendor/android/emulator-entrypoint.sh
  libcxx/utils/ci/vendor/android/emulator-functions.sh
  libcxx/utils/ci/vendor/android/emulator-wait-for-ready.sh
  libcxx/utils/ci/vendor/android/setup-env-for-emulator.sh
  libcxx/utils/ci/vendor/android/start-emulator.sh
  libcxx/utils/ci/vendor/android/stop-emulator.sh
  libcxx/utils/libcxx/test/android.py
  libcxx/utils/libcxx/test/features.py
  libcxxabi/test/configs/llvm-libc++abi-android-ndk.cfg.in
  libcxxabi/test/test_demangle.pass.cpp
  llvm/utils/lit/lit/TestingConfig.py
  runtimes/cmake/android/Arch-arm.cmake
  runtimes/cmake/android/Arch-arm64.cmake
  runtimes/cmake/android/Arch-x86.cmake
  runtimes/cmake/android/Arch-x86_64.cmake
  runtimes/cmake/android/Common.cmake

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139147.557663.patch
Type: text/x-patch
Size: 79030 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20231010/52408609/attachment-0001.bin>


More information about the libcxx-commits mailing list