[compiler-rt] [sanitizer] Use /tmp/ not /tmp/dir/ in tests (PR #117759)
Joel E. Denny via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 26 10:31:27 PST 2024
https://github.com/jdenny-ornl updated https://github.com/llvm/llvm-project/pull/117759
>From 2fb82191b8a54dd00fd002ee633a5f1dadb871e8 Mon Sep 17 00:00:00 2001
From: "Joel E. Denny" <jdenny.ornl at gmail.com>
Date: Tue, 26 Nov 2024 13:03:23 -0500
Subject: [PATCH 1/2] [sanitizer] Use /tmp/ not /tmp/dir/ in tests
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.
---
compiler-rt/lib/sanitizer_common/tests/sanitizer_libc_test.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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);
>From c514b5d6040bd539ea8ba5b6c3919c5bf4eb5aa2 Mon Sep 17 00:00:00 2001
From: "Joel E. Denny" <jdenny.ornl at gmail.com>
Date: Tue, 26 Nov 2024 13:30:58 -0500
Subject: [PATCH 2/2] Apply clang-format
---
compiler-rt/lib/sanitizer_common/tests/sanitizer_libc_test.cpp | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
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 97337ef13e6f41..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),
- "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