[PATCH] More fixes for windows on top of r188299

Tareq A. Siraj tareq.a.siraj at intel.com
Tue Aug 13 14:44:59 PDT 2013


Hi revane, Sarcasm,

On Windows, gnuwin32 provides "\" when expanding path variables with lit where
cygwin provides "/". So instead of injecting the path, just remove the path
and only diff against the file names.

Hopefully this will be the end of the build errors. Tests passed on linux,
darwin, windows gnuwin32/cygwin.

http://llvm-reviews.chandlerc.com/D1390

Files:
  test/cpp11-migrate/HeaderReplacements/common.h.yaml
  test/cpp11-migrate/HeaderReplacements/main.cpp

Index: test/cpp11-migrate/HeaderReplacements/common.h.yaml
===================================================================
--- test/cpp11-migrate/HeaderReplacements/common.h.yaml
+++ test/cpp11-migrate/HeaderReplacements/common.h.yaml
@@ -7,6 +7,6 @@
   - Offset:          506
     Length:          2
     ReplacementText: "elem"
-HeaderFileName: "$(path)/common.h"
-SourceFileName: "$(path)/main.cpp"
+HeaderFileName: "common.h"
+SourceFileName: "main.cpp"
 ...
Index: test/cpp11-migrate/HeaderReplacements/main.cpp
===================================================================
--- test/cpp11-migrate/HeaderReplacements/main.cpp
+++ test/cpp11-migrate/HeaderReplacements/main.cpp
@@ -8,13 +8,11 @@
 // Check that only 1 file is generated per translation unit and header file.
 // RUN: ls -1 %t/Test | grep -c "main.cpp_common.h_.*.yaml" | grep "^1$"
 // RUN: ls -1 %t/Test | grep -c "common.cpp_common.h_.*.yaml" | grep "^1$"
-// RUN: cp %S/common.h.yaml %t/Test/main.cpp_common.h.yaml
-// We need to put the build path to the expected YAML file to diff against the generated one.
-// RUN: sed -e 's#$(path)#%t/Test#g' %S/common.h.yaml > %t/Test/main.cpp_common.h.yaml
-// RUN: sed -i -e 's#\\#/#g' %t/Test/main.cpp_common.h_*.yaml
-// RUN: diff -b %t/Test/main.cpp_common.h.yaml %t/Test/main.cpp_common.h_*.yaml
-// RUN: sed -e 's#$(path)#%t/Test#g' -e 's#main.cpp"#common.cpp"#g' %S/common.h.yaml > %t/Test/common.cpp_common.h.yaml
-// RUN: sed -i -e 's#\\#/#g' %t/Test/common.cpp_common.h_*.yaml
+// We need to remove the path from the file names in the generated YAML file because it will have a path in the temp directory
+// RUN: sed -i -e 's#\(FileName:\).*[/\\]\(.*\)"$#\1 "\2"#g' %t/Test/main.cpp_common.h_*.yaml
+// RUN: diff -b %S/common.h.yaml %t/Test/main.cpp_common.h_*.yaml
+// RUN: sed -e 's#main.cpp"#common.cpp"#g' %S/common.h.yaml > %t/Test/common.cpp_common.h.yaml
+// RUN: sed -i -e 's#\(FileName:\).*[/\\]\(.*\)"$#\1 "\2"#g' %t/Test/common.cpp_common.h_*.yaml
 // RUN: diff -b %t/Test/common.cpp_common.h.yaml %t/Test/common.cpp_common.h_*.yaml
 //
 // The following block tests the following:
@@ -27,10 +25,9 @@
 // Check that only one YAML file is generated from main.cpp and common.h and not from common.cpp and common.h since -header is not specified
 // RUN: ls -1 %t/Test | grep -c "main.cpp_common.h_.*.yaml" | grep "^1$"
 // RUN: ls -1 %t/Test | not grep "common.cpp_common.h_.*.yaml"
-// We need to put the build path to the expected YAML file to diff against the generated one.
-// RUN: sed -e 's#$(path)#%t/Test#g' %S/common.h.yaml > %t/Test/main.cpp_common.h.yaml
-// RUN: sed -i -e 's#\\#/#g' %t/Test/main.cpp_common.h_*.yaml
-// RUN: diff -b %t/Test/main.cpp_common.h.yaml %t/Test/main.cpp_common.h_*.yaml
+// We need to remove the path from the file names in the generated YAML file because it will have a path in the temp directory
+// RUN: sed -i -e 's#\(FileName:\).*[/\\]\(.*\)"$#\1 "\2"#g' %t/Test/main.cpp_common.h_*.yaml
+// RUN: diff -b %S/common.h.yaml %t/Test/main.cpp_common.h_*.yaml
 
 #include "common.h"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D1390.1.patch
Type: text/x-patch
Size: 3068 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130813/a66b2ca8/attachment.bin>


More information about the cfe-commits mailing list