| 1 |
# Check rm file operations. |
| 2 |
# Check force remove commands success whether the file does or doesn't exist. |
| 3 |
# |
| 4 |
# RUN: rm -f %t.write |
| 5 |
# RUN: %{python} %S/../check_path.py file %t.write > %t.out |
| 6 |
# RUN: FileCheck --check-prefix=REMOVE-FILE < %t.out %s |
| 7 |
# RUN: echo "create a temp file" > %t.write |
| 8 |
# RUN: %{python} %S/../check_path.py file %t.write > %t.out |
| 9 |
# RUN: FileCheck --check-prefix=FILE-EXIST < %t.out %s |
| 10 |
# RUN: rm -f %t.write |
| 11 |
# RUN: %{python} %S/../check_path.py file %t.write > %t.out |
| 12 |
# RUN: FileCheck --check-prefix=REMOVE-FILE < %t.out %s |
| 13 |
# |
| 14 |
# REMOVE-FILE: False |
| 15 |
# FILE-EXIST: True |
| 16 |
# |
| 17 |
# Check mkdir and rm folder operations. |
| 18 |
# Check force remove commands success whether the directory does or doesn't exist. |
| 19 |
# |
| 20 |
# Check the mkdir command with -p option. |
| 21 |
# RUN: rm -f -r %t.test |
| 22 |
# RUN: %{python} %S/../check_path.py dir %t.test > %t.out |
| 23 |
# RUN: FileCheck --check-prefix=REMOVE-PARENT-DIR < %t.out %s |
| 24 |
# RUN: mkdir -p %t.test |
| 25 |
# RUN: %{python} %S/../check_path.py dir %t.test > %t.out |
| 26 |
# RUN: FileCheck --check-prefix=MAKE-PARENT-DIR < %t.out %s |
| 27 |
# RUN: rm -f %t.test || true |
| 28 |
# RUN: rm -f -r %t.test |
| 29 |
# RUN: %{python} %S/../check_path.py dir %t.test > %t.out |
| 30 |
# RUN: FileCheck --check-prefix=REMOVE-PARENT-DIR < %t.out %s |
| 31 |
# |
| 32 |
# MAKE-PARENT-DIR: True |
| 33 |
# REMOVE-PARENT-DIR: False |
| 34 |
# |
| 35 |
# Check the mkdir command without -p option. |
| 36 |
# |
| 37 |
# RUN: rm -rf %t.test1 |
| 38 |
# RUN: mkdir %t.test1 |
| 39 |
# RUN: %{python} %S/../check_path.py dir %t.test1 > %t.out |
| 40 |
# RUN: FileCheck --check-prefix=MAKE-DIR < %t.out %s |
| 41 |
# RUN: cd %t.test1 && mkdir foo |
| 42 |
# RUN: %{python} %S/../check_path.py dir %t.test1 > %t.out |
| 43 |
# RUN: FileCheck --check-prefix=MAKE-DIR < %t.out %s |
| 44 |
# RUN: cd .. && rm -rf %t.test1 |
| 45 |
# RUN: %{python} %S/../check_path.py dir %t.test1 > %t.out |
| 46 |
# RUN: FileCheck --check-prefix=REMOVE-DIR < %t.out %s |
| 47 |
# |
| 48 |
# MAKE-DIR: True |
| 49 |
# REMOVE-DIR: False |
| 50 |
# |
| 51 |
# Check creating and removing multiple folders and rm * operation. |
| 52 |
# |
| 53 |
# RUN: rm -rf %t.test |
| 54 |
# RUN: mkdir -p %t.test/test1 %t.test/test2 |
| 55 |
# RUN: %{python} %S/../check_path.py dir %t.test %t.test/test1 %t.test/test2 > %t.out |
| 56 |
# RUN: FileCheck --check-prefix=DIRS-EXIST < %t.out %s |
| 57 |
# RUN: mkdir %t.test || true |
| 58 |
# RUN: echo "create a temp file" > %t.test/temp.write |
| 59 |
# RUN: echo "create a temp1 file" > %t.test/test1/temp1.write |
| 60 |
# RUN: echo "create a temp2 file" > %t.test/test2/temp2.write |
| 61 |
# RUN: %{python} %S/../check_path.py file %t.test/temp.write %t.test/test1/temp1.write %t.test/test2/temp2.write> %t.out |
| 62 |
# RUN: FileCheck --check-prefix=FILES-EXIST < %t.out %s |
| 63 |
# RUN: rm -r -f %t* |
| 64 |
# RUN: %{python} %S/../check_path.py dir %t.test > %t.out |
| 65 |
# RUN: FileCheck --check-prefix=REMOVE-ALL < %t.out %s |
| 66 |
# |
| 67 |
# DIRS-EXIST: True |
| 68 |
# DIRS-EXIST-NEXT: True |
| 69 |
# DIRS-EXIST-NEXT: True |
| 70 |
# FILES-EXIST: True |
| 71 |
# FILES-EXIST-NEXT: True |
| 72 |
# FILES-EXIST-NEXT: True |
| 73 |
# REMOVE-ALL: False |
| 74 |
# |
| 75 |
# Check diff operations. |
| 76 |
# |
| 77 |
# RUN: echo "hello" > %t.stdout |
| 78 |
# RUN: echo "hello" > %t1.stdout |
| 79 |
# RUN: diff %t.stdout %t1.stdout |
| 80 |
# RUN: diff -u %t.stdout %t1.stdout |
| 81 |
# RUN: echo "hello-2" > %t1.stdout |
| 82 |
# RUN: diff %t.stdout %t1.stdout || true |
| 83 |
# |
| 84 |
# RUN: mkdir -p %t.dir1 %t.dir2 |
| 85 |
# RUN: cd %t.dir1 && echo "hello" > temp1.txt |
| 86 |
# RUN: cd %t.dir2 && echo "hello" > temp2.txt |
| 87 |
# RUN: diff temp2.txt ../%{t:stem}.tmp.dir1/temp1.txt |