mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
[lit] Add a test for internal shell execution behaviors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174102 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
3
utils/lit/tests/Inputs/shtest-shell/error-0.txt
Normal file
3
utils/lit/tests/Inputs/shtest-shell/error-0.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
# Check error on an internal shell error (unable to find command).
|
||||
#
|
||||
# RUN: not-a-real-command
|
3
utils/lit/tests/Inputs/shtest-shell/error-1.txt
Normal file
3
utils/lit/tests/Inputs/shtest-shell/error-1.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
# Check error on a shell parsing failure.
|
||||
#
|
||||
# RUN: echo "missing quote
|
3
utils/lit/tests/Inputs/shtest-shell/error-2.txt
Normal file
3
utils/lit/tests/Inputs/shtest-shell/error-2.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
# Check error on a unsupported redirect.
|
||||
#
|
||||
# RUN: echo "hello" 3>&1
|
5
utils/lit/tests/Inputs/shtest-shell/lit.cfg
Normal file
5
utils/lit/tests/Inputs/shtest-shell/lit.cfg
Normal file
@@ -0,0 +1,5 @@
|
||||
config.name = 'shtest-shell'
|
||||
config.suffixes = ['.txt']
|
||||
config.test_format = lit.formats.ShTest()
|
||||
config.test_source_root = None
|
||||
config.test_exec_root = None
|
41
utils/lit/tests/Inputs/shtest-shell/redirects.txt
Normal file
41
utils/lit/tests/Inputs/shtest-shell/redirects.txt
Normal file
@@ -0,0 +1,41 @@
|
||||
# Check stdout redirect (> and >>).
|
||||
#
|
||||
# RUN: echo "not-present" > %t.stdout-write
|
||||
# RUN: echo "is-present" > %t.stdout-write
|
||||
# RUN: FileCheck --check-prefix=STDOUT-WRITE < %t.stdout-write %s
|
||||
#
|
||||
# STDOUT-WRITE-NOT: not-present
|
||||
# STDOUT-WRITE: is-present
|
||||
#
|
||||
# RUN: echo "appended-line" >> %t.stdout-write
|
||||
# RUN: FileCheck --check-prefix=STDOUT-APPEND < %t.stdout-write %s
|
||||
#
|
||||
# STDOUT-APPEND: is-present
|
||||
# STDOUT-APPEND: appended-line
|
||||
|
||||
|
||||
# Check stderr redirect (2> and 2>>).
|
||||
#
|
||||
# RUN: echo "not-present" > %t.stderr-write
|
||||
# RUN: %S/write-to-stderr.sh 2> %t.stderr-write
|
||||
# RUN: FileCheck --check-prefix=STDERR-WRITE < %t.stderr-write %s
|
||||
#
|
||||
# STDERR-WRITE-NOT: not-present
|
||||
# STDERR-WRITE: a line on stderr
|
||||
#
|
||||
# RUN: %S/write-to-stderr.sh 2>> %t.stderr-write
|
||||
# RUN: FileCheck --check-prefix=STDERR-APPEND < %t.stderr-write %s
|
||||
#
|
||||
# STDERR-APPEND: a line on stderr
|
||||
# STDERR-APPEND: a line on stderr
|
||||
|
||||
|
||||
# Check combined redirect (&>).
|
||||
#
|
||||
# RUN: echo "not-present" > %t.combined
|
||||
# RUN: %S/write-to-stdout-and-stderr.sh &> %t.combined
|
||||
# RUN: FileCheck --check-prefix=COMBINED-WRITE < %t.combined %s
|
||||
#
|
||||
# COMBINED-WRITE-NOT: not-present
|
||||
# COMBINED-WRITE: a line on stdout
|
||||
# COMBINED-WRITE: a line on stderr
|
28
utils/lit/tests/Inputs/shtest-shell/sequencing-0.txt
Normal file
28
utils/lit/tests/Inputs/shtest-shell/sequencing-0.txt
Normal file
@@ -0,0 +1,28 @@
|
||||
# Check sequencing operations.
|
||||
#
|
||||
# RUN: echo "first-line" > %t.out && echo "second-line" >> %t.out
|
||||
# RUN: FileCheck --check-prefix CHECK-AND < %t.out %s
|
||||
#
|
||||
# CHECK-AND: first-line
|
||||
# CHECK-AND: second-line
|
||||
#
|
||||
# The false case of && is tested in sequencing-2.txt
|
||||
|
||||
|
||||
# RUN: echo "first-line" > %t.out || echo "second-line" >> %t.out
|
||||
# RUN: FileCheck --check-prefix CHECK-OR-1 < %t.out %s
|
||||
#
|
||||
# CHECK-OR-1: first-line
|
||||
# CHECK-OR-1-NOT: second-line
|
||||
|
||||
# RUN: false || echo "second-line" > %t.out
|
||||
# RUN: FileCheck --check-prefix CHECK-OR-2 < %t.out %s
|
||||
#
|
||||
# CHECK-OR-2: second-line
|
||||
|
||||
|
||||
# RUN: echo "first-line" > %t.out; echo "second-line" >> %t.out
|
||||
# RUN: FileCheck --check-prefix CHECK-SEQ < %t.out %s
|
||||
#
|
||||
# CHECK-SEQ: first-line
|
||||
# CHECK-SEQ: second-line
|
2
utils/lit/tests/Inputs/shtest-shell/sequencing-1.txt
Normal file
2
utils/lit/tests/Inputs/shtest-shell/sequencing-1.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
# RUN: false && true
|
||||
# XFAIL: *
|
3
utils/lit/tests/Inputs/shtest-shell/write-to-stderr.sh
Executable file
3
utils/lit/tests/Inputs/shtest-shell/write-to-stderr.sh
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "a line on stderr" 1>&2
|
4
utils/lit/tests/Inputs/shtest-shell/write-to-stdout-and-stderr.sh
Executable file
4
utils/lit/tests/Inputs/shtest-shell/write-to-stdout-and-stderr.sh
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "a line on stdout"
|
||||
echo "a line on stderr" 1>&2
|
Reference in New Issue
Block a user