[compiler-rt] 81349b8 - [sanitizer] Use /tmp/ not /tmp/dir/ in tests (#117759)

via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 26 14:22:17 PST 2024


Author: Joel E. Denny
Date: 2024-11-26T14:22:14-08:00
New Revision: 81349b84eb0fd2d64f836ddbf3e28638d4a254b8

URL: https://github.com/llvm/llvm-project/commit/81349b84eb0fd2d64f836ddbf3e28638d4a254b8
DIFF: https://github.com/llvm/llvm-project/commit/81349b84eb0fd2d64f836ddbf3e28638d4a254b8.diff

LOG: [sanitizer] Use /tmp/ not /tmp/dir/ in tests (#117759)

Tests fail if the user doesn't own /tmp/dir/. On hosts with multiple
users running the test suite, who owns /tmp/dir/ can become a race.

Added: 
    

Modified: 
    compiler-rt/lib/sanitizer_common/tests/sanitizer_libc_test.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/sanitizer_common/tests/sanitizer_libc_test.cpp b/compiler-rt/lib/sanitizer_common/tests/sanitizer_libc_test.cpp
index 7afa5e43795bcf..272520fa51f01e 100644
--- a/compiler-rt/lib/sanitizer_common/tests/sanitizer_libc_test.cpp
+++ b/compiler-rt/lib/sanitizer_common/tests/sanitizer_libc_test.cpp
@@ -345,8 +345,7 @@ TEST(SanitizerCommon, ReportFile) {
   SpinMutex report_file_mu;
   ReportFile report_file = {&report_file_mu, kStderrFd, "", "", 0};
   char tmpfile[128];
-  temp_file_name(tmpfile, sizeof(tmpfile),
-                 "dir/sanitizer_common.reportfile.tmp.");
+  temp_file_name(tmpfile, sizeof(tmpfile), "sanitizer_common.reportfile.tmp.");
   report_file.SetReportPath(tmpfile);
   const char *path = report_file.GetReportPath();
   EXPECT_EQ(internal_strncmp(tmpfile, path, strlen(tmpfile)), 0);


        


More information about the llvm-commits mailing list