| Haojian Wu | d2a6d7b | 2016-10-04 09:05:31 +0000 | [diff] [blame] | 1 | // RUN: mkdir -p %T/clang-move/build |
| 2 | // RUN: sed 's|$test_dir|%/T/clang-move|g' %S/Inputs/database_template.json > %T/clang-move/compile_commands.json |
| 3 | // RUN: cp %S/Inputs/test* %T/clang-move/ |
| 4 | // RUN: touch %T/clang-move/test2.h |
| 5 | // RUN: cd %T/clang-move |
| 6 | // 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 |
| 7 | // RUN: FileCheck -input-file=%T/clang-move/new_test.cpp -check-prefix=CHECK-NEW-TEST-CPP %s |
| 8 | // RUN: FileCheck -input-file=%T/clang-move/new_test.h -check-prefix=CHECK-NEW-TEST-H %s |
| 9 | // RUN: FileCheck -input-file=%T/clang-move/test.cpp -check-prefix=CHECK-OLD-TEST-CPP %s |
| 10 | // RUN: FileCheck -input-file=%T/clang-move/test.h -check-prefix=CHECK-OLD-TEST-H %s |
| 11 | // |
| 12 | // RUN: cp %S/Inputs/test* %T/clang-move/ |
| 13 | // RUN: cd %T/clang-move |
| 14 | // 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 |
| 15 | // RUN: FileCheck -input-file=%T/clang-move/new_test.cpp -check-prefix=CHECK-NEW-TEST-CPP %s |
| 16 | // RUN: FileCheck -input-file=%T/clang-move/new_test.h -check-prefix=CHECK-NEW-TEST-H %s |
| 17 | // RUN: FileCheck -input-file=%T/clang-move/test.cpp -check-prefix=CHECK-OLD-TEST-CPP %s |
| 18 | // RUN: FileCheck -input-file=%T/clang-move/test.h -check-prefix=CHECK-OLD-TEST-H %s |
| 19 | // |
| 20 | // CHECK-NEW-TEST-H: namespace a { |
| 21 | // CHECK-NEW-TEST-H: class Foo { |
| 22 | // CHECK-NEW-TEST-H: public: |
| 23 | // CHECK-NEW-TEST-H: int f(); |
| 24 | // CHECK-NEW-TEST-H: }; |
| 25 | // CHECK-NEW-TEST-H: } // namespace a |
| 26 | // |
| 27 | // CHECK-NEW-TEST-CPP: #include "{{.*}}new_test.h" |
| 28 | // CHECK-NEW-TEST-CPP: #include "test2.h" |
| 29 | // CHECK-NEW-TEST-CPP: namespace a { |
| 30 | // CHECK-NEW-TEST-CPP: int Foo::f() { return 0; } |
| 31 | // CHECK-NEW-TEST-CPP: } // namespace a |
| 32 | // |
| 33 | // CHECK-OLD-TEST-H: namespace a { |
| 34 | // CHECK-OLD-TEST-H: } // namespace a |
| 35 | // |
| 36 | // CHECK-OLD-TEST-CPP: #include "test.h" |
| 37 | // CHECK-OLD-TEST-CPP: #include "test2.h" |
| 38 | // CHECK-OLD-TEST-CPP: namespace a { |
| 39 | // CHECK-OLD-TEST-CPP: } // namespace a |