[all-commits] [llvm/llvm-project] 6f576d: [libc] android atest compat (#93852)

Nick Desaulniers (paternity leave) via All-commits all-commits at lists.llvm.org
Thu May 30 13:28:33 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6f576d957e7efd2e3b2af90d03e626f0bafbd018
      https://github.com/llvm/llvm-project/commit/6f576d957e7efd2e3b2af90d03e626f0bafbd018
  Author: Nick Desaulniers (paternity leave) <nickdesaulniers at users.noreply.github.com>
  Date:   2024-05-30 (Thu, 30 May 2024)

  Changed paths:
    M libc/test/UnitTest/LibcTest.cpp
    M libc/test/UnitTest/LibcTest.h
    M libc/test/UnitTest/LibcTestMain.cpp
    M libc/test/utils/UnitTest/testfilter_test.cpp

  Log Message:
  -----------
  [libc] android atest compat (#93852)

These changes slighly modify the output of the unittests so that they better
match GTest, so that utilities that parse the expected output from GTest (such
as Android's unit test harness) can read the output from our unit tests.

This allows our unit tests to be run on Android devices.

Add very primitive command line parsing to:
- support --gtest_color=no to disable printing terminal colors.
- recognize --gtest_print_time and print the test time in milliseconds.
  - most of our unit tests run on the order of microseconds, so its useful to
    preserve the existing behavior.  But upsteram GTest ONLY prints time tests
    in milliseconds, and Android's atest expects to be able to parse exactly
    that. Atest always passes --gtest_print_time. The word `took` is removed as
    that also differs from upstream GTest, tripping up parsers.
- ignore other --gtest_* flags

Do so so that atest can parse the output correctly.

Print the test number count before
each run, so that atest can parse this value correctly.

Link: https://android-review.googlesource.com/c/platform/external/llvm-libc/+/3107252
Link: https://google.github.io/googletest/advanced.html#colored-terminal-output
Link: https://google.github.io/googletest/advanced.html#suppressing-the-elapsed-time



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list