88 lines · plain
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.write5# RUN: %{python} %S/../check_path.py file %t.write > %t.out6# RUN: FileCheck --check-prefix=REMOVE-FILE < %t.out %s7# RUN: echo "create a temp file" > %t.write8# RUN: %{python} %S/../check_path.py file %t.write > %t.out9# RUN: FileCheck --check-prefix=FILE-EXIST < %t.out %s10# RUN: rm -f %t.write11# RUN: %{python} %S/../check_path.py file %t.write > %t.out12# RUN: FileCheck --check-prefix=REMOVE-FILE < %t.out %s13#14# REMOVE-FILE: False15# FILE-EXIST: True16#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.test22# RUN: %{python} %S/../check_path.py dir %t.test > %t.out23# RUN: FileCheck --check-prefix=REMOVE-PARENT-DIR < %t.out %s24# RUN: mkdir -p %t.test25# RUN: %{python} %S/../check_path.py dir %t.test > %t.out26# RUN: FileCheck --check-prefix=MAKE-PARENT-DIR < %t.out %s27# RUN: rm -f %t.test || true28# RUN: rm -f -r %t.test29# RUN: %{python} %S/../check_path.py dir %t.test > %t.out30# RUN: FileCheck --check-prefix=REMOVE-PARENT-DIR < %t.out %s31#32# MAKE-PARENT-DIR: True33# REMOVE-PARENT-DIR: False34#35# Check the mkdir command without -p option.36#37# RUN: rm -rf %t.test138# RUN: mkdir %t.test139# RUN: %{python} %S/../check_path.py dir %t.test1 > %t.out40# RUN: FileCheck --check-prefix=MAKE-DIR < %t.out %s41# RUN: cd %t.test1 && mkdir foo42# RUN: %{python} %S/../check_path.py dir %t.test1 > %t.out43# RUN: FileCheck --check-prefix=MAKE-DIR < %t.out %s44# RUN: cd .. && rm -rf %t.test145# RUN: %{python} %S/../check_path.py dir %t.test1 > %t.out46# RUN: FileCheck --check-prefix=REMOVE-DIR < %t.out %s47#48# MAKE-DIR: True49# REMOVE-DIR: False50#51# Check creating and removing multiple folders and rm * operation.52#53# RUN: rm -rf %t.test54# RUN: mkdir -p %t.test/test1 %t.test/test255# RUN: %{python} %S/../check_path.py dir %t.test %t.test/test1 %t.test/test2 > %t.out56# RUN: FileCheck --check-prefix=DIRS-EXIST < %t.out %s57# RUN: mkdir %t.test || true58# RUN: echo "create a temp file" > %t.test/temp.write59# RUN: echo "create a temp1 file" > %t.test/test1/temp1.write60# RUN: echo "create a temp2 file" > %t.test/test2/temp2.write61# RUN: %{python} %S/../check_path.py file %t.test/temp.write %t.test/test1/temp1.write %t.test/test2/temp2.write> %t.out62# RUN: FileCheck --check-prefix=FILES-EXIST < %t.out %s63# RUN: rm -r -f %t*64# RUN: %{python} %S/../check_path.py dir %t.test > %t.out65# RUN: FileCheck --check-prefix=REMOVE-ALL < %t.out %s66#67# DIRS-EXIST: True68# DIRS-EXIST-NEXT: True69# DIRS-EXIST-NEXT: True70# FILES-EXIST: True71# FILES-EXIST-NEXT: True72# FILES-EXIST-NEXT: True73# REMOVE-ALL: False74#75# Check diff operations.76#77# RUN: echo "hello" > %t.stdout78# RUN: echo "hello" > %t1.stdout79# RUN: diff %t.stdout %t1.stdout80# RUN: diff -u %t.stdout %t1.stdout81# RUN: echo "hello-2" > %t1.stdout82# RUN: diff %t.stdout %t1.stdout || true83#84# RUN: mkdir -p %t.dir1 %t.dir285# RUN: cd %t.dir1 && echo "hello" > temp1.txt86# RUN: cd %t.dir2 && echo "hello" > temp2.txt87# RUN: diff temp2.txt ../%{t:stem}.tmp.dir1/temp1.txt88