summaryrefslogtreecommitdiff
path: root/libc/test/integration/src/stdlib/getenv_test.cpp
AgeCommit message (Collapse)Author
2025-11-13[libc][stdlib] Simplify getenv_test by using strcmp instead of custom helper ↵Jeff Bailey
(#163055) [libc][stdlib] Simplify getenv_test by using inline_strcmp instead of custom helper Replace the custom `my_streq` helper function with LLVM libc's `inline_strcmp` utility from `src/string/memory_utils/inline_strcmp.h`. Changes: - Remove 18-line custom `my_streq` implementation - Use `inline_strcmp` with a simple comparator lambda for string comparisons - Replace `my_streq(..., nullptr)` checks with direct `== nullptr` comparisons - Maintain identical test coverage while reducing code duplication Benefits: - Uses existing, well-tested LLVM libc infrastructure - Clearer test assertions with standard comparison functions - More concise code (reduced from ~48 to ~33 lines) - Consistent with LLVM libc coding practices The test continues to verify: - Empty string handling - Invalid name handling ('=') - Missing environment variable queries - Correct retrieval of existing variables (FRANCE, GERMANY, PATH) - Partial name matching behavior (FRANC vs FRANCE, FRANCE1 vs FRANCE)
2025-09-22[libc] Add -Wextra for libc tests (#153321)Vinay Deshmukh
RE apply https://github.com/llvm/llvm-project/pull/133643/commits#top
2025-08-12Revert "[libc] Add -Wextra for libc tests" (#153169)William Huynh
Reverts llvm/llvm-project#133643
2025-08-12[libc] Add -Wextra for libc tests (#133643)Vinay Deshmukh
* Relates to: https://github.com/llvm/llvm-project/issues/119281
2023-09-26[libc] Mass replace enclosing namespace (#67032)Guillaume Chatelet
This is step 4 of https://discourse.llvm.org/t/rfc-customizable-namespace-to-allow-testing-the-libc-when-the-system-libc-is-also-llvms-libc/73079
2023-02-07[libc][NFC] Move UnitTest and IntegrationTest to the 'test' directory.Siva Chandra Reddy
This part of the effort to make all test related pieces into the `test` directory. This helps is excluding test related pieces in a straight forward manner if LLVM_INCLUDE_TESTS is OFF. Future patches will also move the MPFR wrapper and testutils into the 'test' directory.
2022-07-30[libc] Compile integration tests with -ffreestanding to avoid mixup with ↵Siva Chandra Reddy
system libc.
2022-06-19[libc] Revert: Temporary disable environment tests for PATH variable.Siva Chandra Reddy
This reverts commit 2846c2bb4fa4e50b2eb4ff4231825d73840c8c1c. The reason for the disable is not relevant anymore.
2022-06-18[libc] Temporary disable environment tests for PATH variable.Tue Ly
This is blocking fullbuild bot.
2022-03-23[libc] Add a new rule add_integration_test.Siva Chandra Reddy
All existing loader tests are switched to an integration test added with the new rule. Also, the getenv test is now enabled as an integration test. All loader tests have been moved to test/integration. Also, the simple checker library for the previous loader tests has been moved to a separate directory of its own. A follow up change will perform more cleanup of the loader CMake rules to eliminate now redundent options. Reviewed By: lntue, michaelrj Differential Revision: https://reviews.llvm.org/D122266