Skip to content

Conversation

hnrklssn
Copy link
Member

@hnrklssn hnrklssn commented Sep 8, 2025

Previously this test case would touch %S/empty.txt to create and empty file. The test case then copies contents to that file, so if run a second time the touch command would not create an empty file.

Previously this test case would `touch %S/empty.txt` to create and empty
file. The test case then copies contents to that file, so if run a
second time the `touch` command would not create an empty file.
@llvmbot
Copy link
Member

llvmbot commented Sep 8, 2025

@llvm/pr-subscribers-testing-tools

Author: Henrik G. Olsson (hnrklssn)

Changes

Previously this test case would touch %S/empty.txt to create and empty file. The test case then copies contents to that file, so if run a second time the touch command would not create an empty file.


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

2 Files Affected:

  • (modified) llvm/utils/lit/tests/Inputs/diff-test-update/.gitignore (+2-1)
  • (modified) llvm/utils/lit/tests/Inputs/diff-test-update/diff-tmp-dir.test (+3-1)
diff --git a/llvm/utils/lit/tests/Inputs/diff-test-update/.gitignore b/llvm/utils/lit/tests/Inputs/diff-test-update/.gitignore
index 2211df63dd283..dd373bf9e0c66 100644
--- a/llvm/utils/lit/tests/Inputs/diff-test-update/.gitignore
+++ b/llvm/utils/lit/tests/Inputs/diff-test-update/.gitignore
@@ -1 +1,2 @@
-*.txt
+; diff-tmp-dir.test clobbers this file
+empty.txt
diff --git a/llvm/utils/lit/tests/Inputs/diff-test-update/diff-tmp-dir.test b/llvm/utils/lit/tests/Inputs/diff-test-update/diff-tmp-dir.test
index 929c2c1c6c7d3..a4fab7e74c007 100644
--- a/llvm/utils/lit/tests/Inputs/diff-test-update/diff-tmp-dir.test
+++ b/llvm/utils/lit/tests/Inputs/diff-test-update/diff-tmp-dir.test
@@ -1,5 +1,7 @@
 # RUN: mkdir %t
-# RUN: touch %S/empty.txt
+# Tests that if file A is in the %t directory and file B is not,
+# the diff test updater copies from file A to B.
+# RUN: echo "" > %S/empty.txt
 # RUN: cp %S/1.in %t/1.txt
 
 # RUN: diff %t/1.txt %S/empty.txt

This would previously fail on Windows.
@hnrklssn hnrklssn enabled auto-merge (squash) September 8, 2025 23:45
@hnrklssn hnrklssn merged commit 82ef4ee into llvm:main Sep 9, 2025
9 checks passed
hnrklssn added a commit to hnrklssn/llvm-project that referenced this pull request Sep 11, 2025
Previously this test case would `touch %S/empty.txt` to create and empty
file. The test case then copies contents to that file, so if run a
second time the `touch` command would not create an empty file.

`llvm/utils/lit/tests/diff-test-update.py` also no longer matches against file
paths other than the final bit of the file name. This prevents test failures
on Windows due to different path separators.

(cherry picked from commit 82ef4ee)
hnrklssn added a commit to hnrklssn/llvm-project that referenced this pull request Sep 12, 2025
Previously this test case would `touch %S/empty.txt` to create and empty
file. The test case then copies contents to that file, so if run a
second time the `touch` command would not create an empty file.

`llvm/utils/lit/tests/diff-test-update.py` also no longer matches against file
paths other than the final bit of the file name. This prevents test failures
on Windows due to different path separators.

(cherry picked from commit 82ef4ee)
kateinoigakukun pushed a commit to kateinoigakukun/llvm-project that referenced this pull request Sep 17, 2025
Previously this test case would `touch %S/empty.txt` to create and empty
file. The test case then copies contents to that file, so if run a
second time the `touch` command would not create an empty file.

`llvm/utils/lit/tests/diff-test-update.py` also no longer matches against file
paths other than the final bit of the file name. This prevents test failures
on Windows due to different path separators.

(cherry picked from commit 82ef4ee)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants