diff --git a/libc/test/src/__support/File/CMakeLists.txt b/libc/test/src/__support/File/CMakeLists.txt index a11f52978f35f..57c37aa7dd220 100644 --- a/libc/test/src/__support/File/CMakeLists.txt +++ b/libc/test/src/__support/File/CMakeLists.txt @@ -5,8 +5,16 @@ if(NOT (TARGET libc.src.__support.threads.mutex) OR LIBC_TARGET_OS_IS_GPU) return() endif() +# TODO: Investigate the precommit bots' failures of this test and re-enable it. +# https://github.com/llvm/llvm-project/issues/128185. +set(file_test_unit_only "") +if(LIBC_TARGET_OS_IS_LINUX AND LLVM_LIBC_FULL_BUILD) + set(file_test_unit_only "UNIT_TEST_ONLY") +endif() + add_libc_test( file_test + ${file_test_unit_only} SUITE libc-support-tests SRCS @@ -23,6 +31,7 @@ add_libc_test( add_libc_test( platform_file_test + ${file_test_unit_only} SUITE libc-support-tests SRCS diff --git a/libc/test/src/__support/File/file_test.cpp b/libc/test/src/__support/File/file_test.cpp index b3c9f2ba49bce..cf01a78ef6423 100644 --- a/libc/test/src/__support/File/file_test.cpp +++ b/libc/test/src/__support/File/file_test.cpp @@ -113,6 +113,9 @@ StringFile *new_string_file(char *buffer, size_t buflen, int bufmode, LIBC_NAMESPACE::File::mode_flags(mode)); } +// TODO: Investigate the precommit bots' failures of this test and re-enable it. +// https://github.com/llvm/llvm-project/issues/128185. +#if 0 TEST(LlvmLibcFileTest, WriteOnly) { const char data[] = "hello, file"; constexpr size_t FILE_BUFFER_SIZE = sizeof(data) * 3 / 2; @@ -150,6 +153,7 @@ TEST(LlvmLibcFileTest, WriteOnly) { ASSERT_EQ(f->close(), 0); } +#endif TEST(LlvmLibcFileTest, WriteLineBuffered) { const char data[] = "hello\n file"; diff --git a/libc/test/src/__support/File/platform_file_test.cpp b/libc/test/src/__support/File/platform_file_test.cpp index 6b2be2a149329..b232544317b18 100644 --- a/libc/test/src/__support/File/platform_file_test.cpp +++ b/libc/test/src/__support/File/platform_file_test.cpp @@ -20,6 +20,9 @@ LIBC_INLINE File *openfile(const char *file_name, const char *mode) { return error_or_file.has_value() ? error_or_file.value() : nullptr; } +// TODO: Investigate the precommit bots' failures of this test and re-enable it. +// https://github.com/llvm/llvm-project/issues/128185. +#if 0 TEST(LlvmLibcPlatformFileTest, CreateWriteCloseAndReadBack) { constexpr char FILENAME[] = "testdata/create_write_close_and_readback.test"; File *file = openfile(FILENAME, "w"); @@ -40,6 +43,7 @@ TEST(LlvmLibcPlatformFileTest, CreateWriteCloseAndReadBack) { ASSERT_EQ(file->close(), 0); } +#endif TEST(LlvmLibcPlatformFileTest, CreateWriteSeekAndReadBack) { constexpr char FILENAME[] = "testdata/create_write_seek_and_readback.test";