[libc] Add 'UNIT_TEST_ONLY' and 'HERMETIC_TEST_ONLY' to 'add_libc_test'
authorJoseph Huber <jhuber6@vols.utk.edu>
Tue, 2 May 2023 20:54:29 +0000 (15:54 -0500)
committerJoseph Huber <jhuber6@vols.utk.edu>
Tue, 2 May 2023 23:51:12 +0000 (18:51 -0500)
commit644b63bd31f55aaaf1ebafc7df7cd7cea2aa26a8
tree48862dc70805b8726c86b7aa2d6a0c3e208400d4
parent9a20e024a25ce1e20556dc4e567a9d943bff4c7e
[libc] Add 'UNIT_TEST_ONLY' and 'HERMETIC_TEST_ONLY' to 'add_libc_test'

The `add_libc_test` option allows us to enable both kinds of tests in a
single option. However, some tests cannot be made hermetic with the
current approach. Such as tests that rely on system utilities or
libraries. This patch adds two options `UNIT_TEST_ONLY` and
`HERMETIC_TEST_ONLY` to offer more fine-grained control over which
version gets built. This makes it explicit which version a test supports
and why.

Depends on D149662

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D149691
libc/cmake/modules/LLVMLibCTestRules.cmake
libc/test/src/string/memory_utils/CMakeLists.txt