summaryrefslogtreecommitdiff
path: root/clang-tools-extra/test/clang-move
diff options
context:
space:
mode:
authorHaojian Wu <hokein@google.com>2016-10-12 15:50:30 +0000
committerHaojian Wu <hokein@google.com>2016-10-12 15:50:30 +0000
commit5866486eaf4b8ca72be9ece38d65befe85a3e75e (patch)
tree1834d0bc5df7197e62802f0bfbaeb6179317614c /clang-tools-extra/test/clang-move
parent392c5621d2e7d7483240679771a91955cfccb685 (diff)
[clang-move] Compare with real paths of symlinks
Summary: MakeAbsolutePath does wrong things with symlinks previously. When comparing with a symlink, we need to compare with the real path of it. This fixes issues when the build directory is a symlink. Reviewers: ioeric Subscribers: beanz, mgorny, cfe-commits, bkramer Differential Revision: https://reviews.llvm.org/D25508
Diffstat (limited to 'clang-tools-extra/test/clang-move')
-rw-r--r--clang-tools-extra/test/clang-move/Inputs/database_template.json4
-rw-r--r--clang-tools-extra/test/clang-move/move-class.cpp26
2 files changed, 17 insertions, 13 deletions
diff --git a/clang-tools-extra/test/clang-move/Inputs/database_template.json b/clang-tools-extra/test/clang-move/Inputs/database_template.json
index 2dc567ba2b0..ceb499c0139 100644
--- a/clang-tools-extra/test/clang-move/Inputs/database_template.json
+++ b/clang-tools-extra/test/clang-move/Inputs/database_template.json
@@ -1,7 +1,7 @@
[
{
"directory": "$test_dir/build",
- "command": "clang++ -o test.o $test_dir/test.cpp",
- "file": "$test_dir/test.cpp"
+ "command": "clang++ -o test.o -I../include $test_dir/src/test.cpp",
+ "file": "$test_dir/src/test.cpp"
}
]
diff --git a/clang-tools-extra/test/clang-move/move-class.cpp b/clang-tools-extra/test/clang-move/move-class.cpp
index 0c23608a9e9..93d8c4ed215 100644
--- a/clang-tools-extra/test/clang-move/move-class.cpp
+++ b/clang-tools-extra/test/clang-move/move-class.cpp
@@ -1,21 +1,25 @@
// RUN: mkdir -p %T/clang-move/build
+// RUN: mkdir -p %T/clang-move/include
+// RUN: mkdir -p %T/clang-move/src
// RUN: sed 's|$test_dir|%/T/clang-move|g' %S/Inputs/database_template.json > %T/clang-move/compile_commands.json
-// RUN: cp %S/Inputs/test* %T/clang-move/
-// RUN: touch %T/clang-move/test2.h
-// RUN: cd %T/clang-move
-// RUN: clang-move -name="a::Foo" -new_cc=%T/clang-move/new_test.cpp -new_header=%T/clang-move/new_test.h -old_cc=../clang-move/test.cpp -old_header=../clang-move/test.h %T/clang-move/test.cpp
+// RUN: cp %S/Inputs/test.h %T/clang-move/include
+// RUN: cp %S/Inputs/test.cpp %T/clang-move/src
+// RUN: touch %T/clang-move/include/test2.h
+// RUN: cd %T/clang-move/build
+// RUN: clang-move -name="a::Foo" -new_cc=%T/clang-move/new_test.cpp -new_header=%T/clang-move/new_test.h -old_cc=../src/test.cpp -old_header=../include/test.h %T/clang-move/src/test.cpp
// RUN: FileCheck -input-file=%T/clang-move/new_test.cpp -check-prefix=CHECK-NEW-TEST-CPP %s
// RUN: FileCheck -input-file=%T/clang-move/new_test.h -check-prefix=CHECK-NEW-TEST-H %s
-// RUN: FileCheck -input-file=%T/clang-move/test.cpp -check-prefix=CHECK-OLD-TEST-CPP %s
-// RUN: FileCheck -input-file=%T/clang-move/test.h %s -implicit-check-not='{{namespace.*}}'
+// RUN: FileCheck -input-file=%T/clang-move/src/test.cpp -check-prefix=CHECK-OLD-TEST-CPP %s
+// RUN: FileCheck -input-file=%T/clang-move/include/test.h %s -implicit-check-not='{{namespace.*}}'
//
-// RUN: cp %S/Inputs/test* %T/clang-move/
-// RUN: cd %T/clang-move
-// RUN: clang-move -name="a::Foo" -new_cc=%T/clang-move/new_test.cpp -new_header=%T/clang-move/new_test.h -old_cc=%T/clang-move/test.cpp -old_header=%T/clang-move/test.h %T/clang-move/test.cpp
+// RUN: cp %S/Inputs/test.h %T/clang-move/include
+// RUN: cp %S/Inputs/test.cpp %T/clang-move/src
+// RUN: cd %T/clang-move/build
+// RUN: clang-move -name="a::Foo" -new_cc=%T/clang-move/new_test.cpp -new_header=%T/clang-move/new_test.h -old_cc=%T/clang-move/src/test.cpp -old_header=%T/clang-move/include/test.h %T/clang-move/src/test.cpp
// RUN: FileCheck -input-file=%T/clang-move/new_test.cpp -check-prefix=CHECK-NEW-TEST-CPP %s
// RUN: FileCheck -input-file=%T/clang-move/new_test.h -check-prefix=CHECK-NEW-TEST-H %s
-// RUN: FileCheck -input-file=%T/clang-move/test.cpp -check-prefix=CHECK-OLD-TEST-CPP %s
-// RUN: FileCheck -input-file=%T/clang-move/test.h %s -implicit-check-not='{{namespace.*}}'
+// RUN: FileCheck -input-file=%T/clang-move/src/test.cpp -check-prefix=CHECK-OLD-TEST-CPP %s
+// RUN: FileCheck -input-file=%T/clang-move/include/test.h %s -implicit-check-not='{{namespace.*}}'
//
// CHECK-NEW-TEST-H: namespace a {
// CHECK-NEW-TEST-H: class Foo {