diff options
author | Tareq A. Siraj <tareq.a.siraj@intel.com> | 2013-08-13 17:53:00 +0000 |
---|---|---|
committer | Tareq A. Siraj <tareq.a.siraj@intel.com> | 2013-08-13 17:53:00 +0000 |
commit | 8e1c269a61440a24b7c4d24ada2d9ac0db2f1084 (patch) | |
tree | ffaa94b2d22d0be511e0b4da3511491951044b0a /clang-tools-extra/test/cpp11-migrate | |
parent | bac096a614bce07a65a782111892d013728128e2 (diff) | |
download | bcm5719-llvm-8e1c269a61440a24b7c4d24ada2d9ac0db2f1084.tar.gz bcm5719-llvm-8e1c269a61440a24b7c4d24ada2d9ac0db2f1084.zip |
Fixes test failure on darwin introduced by r188274
Reworked how the tests dealt with paths. Instead of removing the full path name,
put a marker in the expected file and replace the marker with the full path
before running diff.
Differential Revision: http://llvm-reviews.chandlerc.com/D1381
llvm-svn: 188299
Diffstat (limited to 'clang-tools-extra/test/cpp11-migrate')
-rw-r--r-- | clang-tools-extra/test/cpp11-migrate/HeaderReplacements/common.h.yaml | 4 | ||||
-rw-r--r-- | clang-tools-extra/test/cpp11-migrate/HeaderReplacements/main.cpp | 17 |
2 files changed, 11 insertions, 10 deletions
diff --git a/clang-tools-extra/test/cpp11-migrate/HeaderReplacements/common.h.yaml b/clang-tools-extra/test/cpp11-migrate/HeaderReplacements/common.h.yaml index 9123bd8db16..7bd17f045ae 100644 --- a/clang-tools-extra/test/cpp11-migrate/HeaderReplacements/common.h.yaml +++ b/clang-tools-extra/test/cpp11-migrate/HeaderReplacements/common.h.yaml @@ -7,6 +7,6 @@ Replacements: - Offset: 506 Length: 2 ReplacementText: "elem" -HeaderFileName: "common.h" -SourceFileName: "main.cpp" +HeaderFileName: "$(path)/common.h" +SourceFileName: "$(path)/main.cpp" ... diff --git a/clang-tools-extra/test/cpp11-migrate/HeaderReplacements/main.cpp b/clang-tools-extra/test/cpp11-migrate/HeaderReplacements/main.cpp index 72c32f1cdea..2fa2da9703e 100644 --- a/clang-tools-extra/test/cpp11-migrate/HeaderReplacements/main.cpp +++ b/clang-tools-extra/test/cpp11-migrate/HeaderReplacements/main.cpp @@ -8,13 +8,13 @@ // 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$" -// We need to remove the path from FileNames in the generated YAML file because it will have a path in the temp directory -// RUN: sed -i -e 's/^\(HeaderFileName:\|SourceFileName:\).*[\/\\]\(.*\)"$/\1 "\2"/g' %t/Test/main.cpp_common.h_*.yaml // 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 -i -e 's/^\(HeaderFileName:\|SourceFileName:\).*[\/\\]\(.*\)"$/\1 "\2"/g' %t/Test/common.cpp_common.h_*.yaml -// RUN: cp %S/common.h.yaml %t/Test/common.cpp_common.h.yaml -// RUN: sed -i -e 's/^SourceFileName: "main.cpp"$/SourceFileName: "common.cpp"/g' %t/Test/common.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 // RUN: diff -b %t/Test/common.cpp_common.h.yaml %t/Test/common.cpp_common.h_*.yaml // // The following block tests the following: @@ -27,9 +27,10 @@ // 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 remove the path from FileName in the generated YAML file because it will have a path in the temp directory -// RUN: sed -i -e 's/^\(HeaderFileName:\|SourceFileName:\).*[\/\\]\(.*\)"$/\1 "\2"/g' %t/Test/main.cpp_common.h_*.yaml -// RUN: diff -b %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 #include "common.h" |