[llvm] [llvm][llvm-lit] Add option to create unique result file names if results already exist (PR #112729)
David Spickett via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 21 02:42:56 PDT 2024
================
@@ -1,28 +1,20 @@
-# Check that lit will not overwrite existing result files when given
-# --use-unique-output-file-name.
+## Check that lit will not overwrite existing result files when given
+## --use-unique-output-file-name.
-# Files are overwritten without the option.
+## Files are overwritten without the option.
# RUN: rm -f %t.xunit*.xml
# RUN: echo "test" > %t.xunit.xml
# RUN: not %{lit} --xunit-xml-output %t.xunit.xml %{inputs}/xunit-output
# RUN: FileCheck < %t.xunit.xml %s --check-prefix=NEW
+# NEW: <?xml version="1.0" encoding="UTF-8"?>
+# NEW-NEXT: <testsuites time="{{[0-9.]+}}">
+## (other tests will check the contents of the whole file)
# RUN: rm -f %t.xunit*.xml
# RUN: echo "test" > %t.xunit.xml
-# Files should not be overwritten with the option.
+## Files should not be overwritten with the option.
# RUN: not %{lit} --xunit-xml-output %t.xunit.xml --use-unique-output-file-name %{inputs}/xunit-output
# RUN: FileCheck < %t.xunit.xml %s --check-prefix=EXISTING
# EXISTING: test
-# Results in a new file with "1" added.
-# RUN: FileCheck < %t.xunit.1.xml %s --check-prefix=NEW
-# NEW: <?xml version="1.0" encoding="UTF-8"?>
-# NEW-NEXT: <testsuites time="{{[0-9.]+}}">
-# (assuming that other tests check the whole contents of the file)
-
-# The number should increment as many times as needed.
-# RUN: touch %t.xunit.2.xml
-# RUN: touch %t.xunit.3.xml
-# RUN: touch %t.xunit.4.xml
-
-# RUN: not %{lit} --xunit-xml-output %t.xunit.xml --use-unique-output-file-name %{inputs}/xunit-output
-# RUN: FileCheck < %t.xunit.5.xml %s --check-prefix=NEW
\ No newline at end of file
+## Results in a new file with some discriminator added.
+# RUN: FileCheck < %t.xunit.*.xml %s --check-prefix=NEW
----------------
DavidSpickett wrote:
`ls -l` into `wc` let me check the number of files without knowing their exact names.
https://github.com/llvm/llvm-project/pull/112729
More information about the llvm-commits
mailing list