final set of wish tests

This commit is contained in:
Remzi Arpaci-Dusseau
2019-02-18 19:45:13 -05:00
parent 206a461d62
commit 880a1ca18b
106 changed files with 172 additions and 0 deletions

10
processes-shell/test-wish.sh Executable file
View File

@@ -0,0 +1,10 @@
#! /bin/bash
if ! [[ -x wish ]]; then
echo "wish executable does not exist"
exit 1
fi
../tester/run-tests.sh $*

View File

@@ -0,0 +1 @@
Redirection with multiple '>'

View File

@@ -0,0 +1 @@
An error has occurred

View File

@@ -0,0 +1,2 @@
ls > output.9 > output.10
exit

View File

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@
./wish tests/10.in

View File

@@ -0,0 +1 @@
Normal redirection.

View File

View File

@@ -0,0 +1,4 @@
ls tests/p2a-test>/tmp/output11
cat /tmp/output11
rm -f /tmp/output11
exit

View File

@@ -0,0 +1,4 @@
test1
test2
test3
test4

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@
./wish tests/11.in

View File

@@ -0,0 +1 @@
Input to check bad redirection. Contains no command before '>'.

View File

@@ -0,0 +1 @@
An error has occurred

View File

@@ -0,0 +1,2 @@
> output.12
exit

View File

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@
./wish tests/12.in

View File

@@ -0,0 +1 @@
Input file is valid and empty. But shell is invoked in batch mode with 2 files (with same file 13.in used twice)

View File

@@ -0,0 +1 @@
An error has occurred

View File

View File

View File

@@ -0,0 +1 @@
1

View File

@@ -0,0 +1 @@
./wish tests/13.in INPUT_DIR/13.in

View File

@@ -0,0 +1 @@
Shell is invoked with a bad batch file.

View File

@@ -0,0 +1 @@
An error has occurred

View File

View File

View File

@@ -0,0 +1 @@
1

View File

@@ -0,0 +1 @@
./wish tests/p2a-tests/bad

View File

@@ -0,0 +1 @@
Tests command with variable whitespace.

View File

View File

@@ -0,0 +1,3 @@
echo test variable whitespace!
exit

View File

@@ -0,0 +1 @@
test variable whitespace!

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@
./wish tests/15.in

View File

@@ -0,0 +1 @@
Command only contains &

View File

View File

@@ -0,0 +1,2 @@
&
exit

View File

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@
./wish tests/16.in

View File

@@ -0,0 +1 @@
Parallel command contains & at the end

View File

View File

@@ -0,0 +1,3 @@
path tests
p1.sh & p2.sh &
exit

View File

@@ -0,0 +1,5 @@
test1
test2
test3
test4
test2

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@
./wish tests/17.in

View File

@@ -0,0 +1 @@
Basic test of running parallel commands.

View File

View File

@@ -0,0 +1,3 @@
path tests
p1.sh & p2.sh & p3.sh
exit

View File

@@ -0,0 +1,6 @@
test1
test2
test3
test4
test2
Linux

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@
./wish tests/18.in

View File

@@ -0,0 +1 @@
Parallel commands with no space between command and '&'

View File

View File

@@ -0,0 +1,3 @@
path tests
p1.sh&p2.sh&p3.sh
exit

View File

@@ -0,0 +1,6 @@
test1
test2
test3
test4
test2
Linux

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@
./wish tests/19.in

View File

@@ -0,0 +1 @@
Redirection and Parallel commands combined

View File

View File

@@ -0,0 +1,9 @@
path /bin tests
p1.sh > /tmp/output201 & p2.sh > /tmp/output202 & p3.sh > /tmp/output203
cat /tmp/output201
cat /tmp/output202
cat /tmp/output203
rm -rf /tmp/output201
rm -rf /tmp/output202
rm -rf /tmp/output203
exit

View File

@@ -0,0 +1,6 @@
test1
test2
test3
test4
test2
Linux

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@
./wish tests/20.in

View File

@@ -0,0 +1 @@
Empty commands

View File

View File

@@ -0,0 +1,6 @@
exit

View File

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@
./wish tests/21.in

View File

@@ -0,0 +1 @@
Test to check that commands are not executed serially

View File

View File

@@ -0,0 +1,5 @@
path /bin tests
p5.sh > /tmp/output22 & p4.sh > /tmp/output22
cat /tmp/output22
rm -f /tmp/output22
exit

View File

@@ -0,0 +1,4 @@
test1
test2
test3
test4

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@
./wish tests/22.in

View File

@@ -0,0 +1 @@
Set path, run a shell script. Overwrite path and then try running the script again.

View File

@@ -0,0 +1,2 @@
An error has occurred
An error has occurred

View File

@@ -0,0 +1,6 @@
path tests
p1.sh
path
p1.sh
ls
exit

View File

@@ -0,0 +1,4 @@
test1
test2
test3
test4

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@
./wish tests/7.in

View File

@@ -0,0 +1 @@
Redirection with no output file specified.

View File

@@ -0,0 +1 @@
An error has occurred

View File

@@ -0,0 +1,2 @@
ls >
exit

View File

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@
./wish tests/8.in

View File

@@ -0,0 +1 @@
Redirection with multiple output files.

View File

@@ -0,0 +1 @@
An error has occurred

View File

@@ -0,0 +1,2 @@
ls > output.9 output.10
exit

View File

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@
./wish tests/9.in

3
processes-shell/tests/p1.sh Executable file
View File

@@ -0,0 +1,3 @@
#! /bin/bash
cd tests/p2a-test
ls

5
processes-shell/tests/p2.sh Executable file
View File

@@ -0,0 +1,5 @@
#!/bin/bash
sleep 3
cd tests/p2a-test
ls test2

View File

Some files were not shown because too many files have changed in this diff Show More