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

via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 26 10:21:13 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-compiler-rt-sanitizer

Author: Joel E. Denny (jdenny-ornl)

<details>
<summary>Changes</summary>

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.

---
Full diff: https://github.com/llvm/llvm-project/pull/117759.diff


1 Files Affected:

- (modified) compiler-rt/lib/sanitizer_common/tests/sanitizer_libc_test.cpp (+1-1) 


``````````diff
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..97337ef13e6f41 100644
--- a/compiler-rt/lib/sanitizer_common/tests/sanitizer_libc_test.cpp
+++ b/compiler-rt/lib/sanitizer_common/tests/sanitizer_libc_test.cpp
@@ -346,7 +346,7 @@ TEST(SanitizerCommon, ReportFile) {
   ReportFile report_file = {&report_file_mu, kStderrFd, "", "", 0};
   char tmpfile[128];
   temp_file_name(tmpfile, sizeof(tmpfile),
-                 "dir/sanitizer_common.reportfile.tmp.");
+                 "sanitizer_common.reportfile.tmp.");
   report_file.SetReportPath(tmpfile);
   const char *path = report_file.GetReportPath();
   EXPECT_EQ(internal_strncmp(tmpfile, path, strlen(tmpfile)), 0);

``````````

</details>


https://github.com/llvm/llvm-project/pull/117759


More information about the llvm-commits mailing list