Skip to content

Commit

Permalink
Re-structure Test older structure (#31)
Browse files Browse the repository at this point in the history
Re-structure Test Directory Structure
  • Loading branch information
allenh1 authored Sep 13, 2018
1 parent 1b8e42e commit e3e59d0
Show file tree
Hide file tree
Showing 55 changed files with 50 additions and 49 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ script:
- make -j$(nproc)
- ln -sf $(pwd)/yash $(pwd)/../shell
- ln -sf $(pwd)/yash $(pwd)/../src/yash
- cd ../test
- export SHELL_BIN=$(pwd)/yash
- cd ../test/script-tests
- export LC_COLLATE="C"
- export IS_TRAVIS="YES"
- ./testall
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions test/issue-21-test → test/script-tests/issue-21-test
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ echo "pwd" >> simple_cd
echo ${cd_cmd} > shane_cd
echo "pwd" >> shane_cd

../src/yash < simple_cd &>> simple_out
../src/yash < shane_cd &>> shane_out
${SHELL_BIN} < simple_cd &>> simple_out
${SHELL_BIN} < shane_cd &>> shane_out

diff simple_out shane_out

Expand Down
6 changes: 3 additions & 3 deletions test/issue-33-test → test/script-tests/issue-33-test
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ mkdir -p a

echo "cd a" > yash-in
echo "cd a" > bash-in
echo "echo ../../test/*" >> yash-in
echo "echo ../../test/*" >> bash-in
echo "echo ../../script-tests/*" >> yash-in
echo "echo ../../script-tests/*" >> bash-in

/bin/bash < bash-in > bash-out 2>&1
../src/yash < yash-in > yash-out 2>&1
${SHELL_BIN} < yash-in > yash-out 2>&1

rm -rf a

Expand Down
2 changes: 1 addition & 1 deletion test/issue-48-test → test/script-tests/issue-48-test
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ echo "pwd" >> yash-in
correct="$(pwd)/a/second"
echo "$correct" > yash-out.org

../src/yash < yash-in > yash-out 2>&1
${SHELL_BIN} < yash-in > yash-out 2>&1

rm -rf a

Expand Down
2 changes: 1 addition & 1 deletion test/issue-53-test → test/script-tests/issue-53-test
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ echo "echo \"*\"" >> yash-in
echo "echo \"*\"" >> bash-in

/bin/bash < bash-in > bash-out 2>&1
../src/yash < yash-in > yash-out 2>&1
${SHELL_BIN} < yash-in > yash-out 2>&1

rm -rf a

Expand Down
2 changes: 1 addition & 1 deletion test/issue-58-test → test/script-tests/issue-58-test
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ echo "cat ~/test.txt" >> bash-in
echo "rm -f ~/test.txt" >> bash-in

/bin/bash < bash-in > bash-out 2>&1
../src/yash < yash-in > yash-out 2>&1
${SHELL_BIN} < yash-in > yash-out 2>&1

diff yash-out bash-out
if [ $? -ne 0 ]
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion test/test1 → test/script-tests/test1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ rm -f out1 out2
echo "ls files > out1" > yash-in
echo "ls files > out2" > csh-in
/bin/sh < csh-in > csh-out
../src/yash < yash-in > yash-out
${SHELL_BIN} < yash-in > yash-out

diff out1 out2
if [ $? -ne 0 ]
Expand Down
2 changes: 1 addition & 1 deletion test/test10 → test/script-tests/test10
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ echo "ls &" >> shell-in
echo "ls &" >> shell-in
echo "sleep 5" >> shell-in

../src/yash < shell-in > shell-out &
${SHELL_BIN} < shell-in > shell-out &

sleep 5

Expand Down
2 changes: 1 addition & 1 deletion test/test102 → test/script-tests/test102
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ echo "cd /etc" > shell-in
echo "pwd" >> shell-in

/bin/sh < shell-in > csh-out 2>&1
../src/yash < shell-in > shell-out 2>&1
${SHELL_BIN} < shell-in > shell-out 2>&1

diff shell-out csh-out
if [ $? -ne 0 ]
Expand Down
2 changes: 1 addition & 1 deletion test/test103 → test/script-tests/test103
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ echo "cd" > csh-in
echo "/bin/pwd" >> csh-in

/bin/sh < csh-in > csh-out 2>&1
../src/yash < shell-in > shell-out 2>&1
${SHELL_BIN} < shell-in > shell-out 2>&1

diff shell-out csh-out
if [ $? -ne 0 ]
Expand Down
2 changes: 1 addition & 1 deletion test/test104 → test/script-tests/test104
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ echo "cd ${HOME}" > shell-in
echo "/bin/pwd" >> shell-in

/bin/sh < shell-in > csh-out 2>&1
../src/yash < shell-in > shell-out 2>&1
${SHELL_BIN} < shell-in > shell-out 2>&1

diff shell-out csh-out
if [ $? -ne 0 ]
Expand Down
2 changes: 1 addition & 1 deletion test/test105 → test/script-tests/test105
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ echo "Test105: cd notfound >& err1"
echo "cd notfound >& err1" > shell-in
echo "pwd" >> csh-in

../src/yash < shell-in > shell-out 2>&1
${SHELL_BIN} < shell-in > shell-out 2>&1

grep "No such file or directory" err1
if [ $? -ne 0 ]
Expand Down
2 changes: 1 addition & 1 deletion test/test106 → test/script-tests/test106
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ echo "cd /etc" > shell-in
echo "pwd" >> shell-in

/bin/sh < shell-in > csh-out 2>&1
../src/yash < shell-in > shell-out 2>&1
${SHELL_BIN} < shell-in > shell-out 2>&1

diff csh-out shell-out
if [ $? -ne 0 ]
Expand Down
2 changes: 1 addition & 1 deletion test/test107 → test/script-tests/test107
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ echo "echo *" > shell-in
echo "echo *" > csh-in

/bin/sh < csh-in > csh-out 2>&1
../src/yash < shell-in > shell-out 2>&1
${SHELL_BIN} < shell-in > shell-out 2>&1

diff shell-out csh-out
if [ $? -ne 0 ]
Expand Down
2 changes: 1 addition & 1 deletion test/test108 → test/script-tests/test108
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ echo "echo /usr/lib/*" > yash-in
echo "echo /usr/lib/*" > bash-in

/bin/bash < bash-in > bash-out 2>&1
../src/yash < yash-in > yash-out 2>&1
${SHELL_BIN} < yash-in > yash-out 2>&1

_diff=$(diff yash-out bash-out)
if [[ $? -ne 0 ]]; then
Expand Down
2 changes: 1 addition & 1 deletion test/test109 → test/script-tests/test109
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ echo "echo /usr/lib/libt*" > shell-in
echo "echo /usr/lib/libt*" > csh-in

/bin/sh < csh-in > csh-out 2>&1
../src/yash < shell-in > shell-out 2>&1
${SHELL_BIN} < shell-in > shell-out 2>&1

diff shell-out csh-out
if [ $? -ne 0 ]
Expand Down
2 changes: 1 addition & 1 deletion test/test11 → test/script-tests/test11
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ echo "Test11: Enviroment: Set variable"
echo "setenv aaa bbbb" > shell-in
echo "printenv" >> shell-in

../src/yash < shell-in > shell-out
${SHELL_BIN} < shell-in > shell-out

grep aaa=bbbb shell-out > out 2>&1
if [ $? -ne 0 ]
Expand Down
2 changes: 1 addition & 1 deletion test/test110 → test/script-tests/test110
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ echo "echo /usr/lib/*ck*" > shell-in
echo "echo /usr/lib/*ck*" > csh-in

/bin/sh < csh-in > csh-out 2>&1
../src/yash < shell-in > shell-out 2>&1
${SHELL_BIN} < shell-in > shell-out 2>&1

diff shell-out csh-out
if [ $? -ne 0 ]
Expand Down
2 changes: 1 addition & 1 deletion test/test111 → test/script-tests/test111
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ echo "echo *" >> shell-in
echo "echo .*" >> shell-in

/bin/bash < shell-in > bash-out 2>&1
../src/yash < shell-in > yash-out 2>&1
${SHELL_BIN} < shell-in > yash-out 2>&1

yash_out=$(cat yash-out | sort --field-separator=' ')
bash_out=$(cat bash-out | sort --field-separator=' ')
Expand Down
2 changes: 1 addition & 1 deletion test/test112 → test/script-tests/test112
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ echo "Test112: echo /etc/r*/*s* "
echo "echo /etc/r*/*s*" > yash-in

/bin/bash < yash-in > bash-out 2>&1
../src/yash < yash-in > yash-out 2>&1
${SHELL_BIN} < yash-in > yash-out 2>&1

yash_out=$(sort yash-out)
bash_out=$(sort bash-out)
Expand Down
2 changes: 1 addition & 1 deletion test/test112-2 → test/script-tests/test112-2
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ echo "Test112-2: echo /usr/lib/lib?.a"
echo "echo /usr/lib/lib?.a" > shell-in

/bin/sh < shell-in > csh-out 2>&1
../shell < shell-in > shell-out 2>&1
${SHELL_BIN} < shell-in > shell-out 2>&1

diff shell-out csh-out
if [ $? -ne 0 ]
Expand Down
2 changes: 1 addition & 1 deletion test/test113 → test/script-tests/test113
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ echo "cd" > csh-in
echo "echo lll \">\"" >> csh-in

/bin/sh < csh-in > csh-out 2>&1
../shell < shell-in > shell-out 2>&1
${SHELL_BIN} < shell-in > shell-out 2>&1

diff shell-out csh-out
if [ $? -ne 0 ]
Expand Down
2 changes: 1 addition & 1 deletion test/test114 → test/script-tests/test114
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ echo "ls file1.cc files" > csh-in
echo "ls \"file1.cc files\"" >> csh-in

/bin/sh < csh-in > csh-out 2>&1
../shell < shell-in > shell-out 2>&1
${SHELL_BIN} < shell-in > shell-out 2>&1

diff shell-out csh-out
if [ $? -ne 0 ]
Expand Down
2 changes: 1 addition & 1 deletion test/test115 → test/script-tests/test115
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ echo "Test115: touch \"hello world\""
echo "touch \"hello world\"" > shell-in
echo "ls" >> shell-in

../shell < shell-in > shell-out 2>&1
${SHELL_BIN} < shell-in > shell-out 2>&1

if [ ! -f "hello world" ]
then
Expand Down
2 changes: 1 addition & 1 deletion test/test116 → test/script-tests/test116
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ rm -f csh-out shell-out
echo "Test116: Escape Chars"
echo "echo lll\< kkkk\\\\\\ uuuu\&" > shell-in

../shell < shell-in > shell-out 2>&1
${SHELL_BIN} < shell-in > shell-out 2>&1

grep "lll< kkkk[\] uuuu&" shell-out
if [ $? -ne 0 ]
Expand Down
2 changes: 1 addition & 1 deletion test/test13 → test/script-tests/test13
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ echo "setenv aaa bbbb" > shell-in
echo "setenv aaa pppp" >> shell-in
echo "printenv" >> shell-in

../shell < shell-in > shell-out
${SHELL_BIN} < shell-in > shell-out

grep aaa=pppp shell-out > out 2>&1
if [ $? -ne 0 ]
Expand Down
2 changes: 1 addition & 1 deletion test/test14 → test/script-tests/test14
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ echo "printenv" >> shell-in
echo "unsetenv aaa" >> shell-in
echo "printenv" >> shell-in

../shell < shell-in > shell-out
${SHELL_BIN} < shell-in > shell-out

res=`grep -c aaa= shell-out`
if [ $res -ne 1 ]
Expand Down
2 changes: 1 addition & 1 deletion test/test15 → test/script-tests/test15
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ echo "B=world" >> csh-in
echo "echo \${A} \${B}" >> csh-in

/bin/sh < csh-in > csh-out 2>&1
../shell < shell-in > shell-out
${SHELL_BIN} < shell-in > shell-out

diff shell-out csh-out
if [ $? -ne 0 ]
Expand Down
2 changes: 1 addition & 1 deletion test/test16 → test/script-tests/test16
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ echo "setenv C ap" > shell-in
echo "setenv D le" >> shell-in
echo "echo I like \${C}p\${D}" >> shell-in

../shell < shell-in > shell-out
${SHELL_BIN} < shell-in > shell-out

grep "I like apple" shell-out
if [ $? -ne 0 ]
Expand Down
2 changes: 1 addition & 1 deletion test/test17 → test/script-tests/test17
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ echo "Test17: Parsing: words and special characters"
echo "ls file1.cc>out1" > shell-in
echo "ls file1.cc>out2" > csh-in
/bin/sh < csh-in > csh-out
../shell < shell-in > shell-out
${SHELL_BIN} < shell-in > shell-out

diff out1 out2
if [ $? -ne 0 ]
Expand Down
2 changes: 1 addition & 1 deletion test/test18 → test/script-tests/test18
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ echo "Test18: Parsing: words and special characters"
echo "ls|grep fil" > shell-in
echo "ls|grep fil" > csh-in
/bin/sh < csh-in > csh-out
../shell < shell-in > shell-out
${SHELL_BIN} < shell-in > shell-out

diff shell-out csh-out
if [ $? -ne 0 ]
Expand Down
2 changes: 1 addition & 1 deletion test/test2 → test/script-tests/test2
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ echo "Test2: Test stdin redirection"
echo "cat < files/aaa" > shell-in
echo "cat < files/aaa" > csh-in
/bin/sh < csh-in > csh-out
../shell < shell-in > shell-out
${SHELL_BIN} < shell-in > shell-out

diff csh-out shell-out
if [ $? -ne 0 ]
Expand Down
2 changes: 1 addition & 1 deletion test/test201 → test/script-tests/test201
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
echo "Test201: test ctrl-c"
echo "sleep 10" > shell-in

../shell < shell-in > shell-out &
${SHELL_BIN} < shell-in > shell-out &

# Send ctrl-c to process
sleep 1
Expand Down
2 changes: 1 addition & 1 deletion test/test202 → test/script-tests/test202
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ echo "ls " >> shell-in
echo "ls " >> shell-in

/bin/sh < shell-in > csh-out 2>&1
../shell < shell-in > shell-out 2>&1
${SHELL_BIN} < shell-in > shell-out 2>&1

diff csh-out shell-out > temp-out 2>&1
if [ $? -ne 0 ]
Expand Down
2 changes: 1 addition & 1 deletion test/test203 → test/script-tests/test203
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ echo "Test203: test subshell"

echo "ls test3* > file-list " > shell-in
echo "ls -al \`cat file-list\` " >> shell-in
../shell < shell-in > shell-out
${SHELL_BIN} < shell-in > shell-out

echo "ls test3* > file-list" > csh-in
echo "ls -al \`cat file-list\` " >> csh-in
Expand Down
2 changes: 1 addition & 1 deletion test/test204 → test/script-tests/test204
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ echo "ls ~cs180 >> out2" >> shell-in
echo "ls ~cs180/share >> out2" >> shell-in

/bin/bash < csh-in > csh-out
../shell < shell-in > shell-out
${SHELL_BIN} < shell-in > shell-out


diff out1 out2 > /dev/null 2>&1
Expand Down
2 changes: 1 addition & 1 deletion test/test3 → test/script-tests/test3
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ echo "ls /none >& err1" > yash-in
echo "ls /none &> err2" > bash-in

/bin/bash < bash-in
../src/yash < yash-in
${SHELL_BIN} < yash-in

diff ./err1 ./err2

Expand Down
2 changes: 1 addition & 1 deletion test/test3-2 → test/script-tests/test3-2
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ echo "ls files > out2" >> csh-in
echo "ls files >> out2" >> csh-in

/bin/sh < csh-in > csh-out
../shell < shell-in > shell-out
${SHELL_BIN} < shell-in > shell-out

diff out1 out2
if [ $? -ne 0 ]
Expand Down
4 changes: 2 additions & 2 deletions test/test3-3 → test/script-tests/test3-3
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ echo "/bin/ls notfound >& err1" > shell-in
echo "/bin/ls notfound > err2 2>&1" > csh-in

/bin/sh < csh-in > csh-out 2>&1
../shell < shell-in > shell-out 2>&1
${SHELL_BIN} < shell-in > shell-out 2>&1

diff err1 err2
if [ $? -ne 0 ]
Expand All @@ -19,7 +19,7 @@ echo "ls notfound >>& err1" > shell-in
echo "ls notfound >> err2 2>&1" > csh-in

/bin/sh < csh-in > csh-out 2>&1
../shell < shell-in > shell-out 2>&1
${SHELL_BIN} < shell-in > shell-out 2>&1

diff err1 err2
if [ $? -ne 0 ]
Expand Down
2 changes: 1 addition & 1 deletion test/test4 → test/script-tests/test4
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ rm -f out1 out2
rm -f csh-out shell-out
echo "Test4: Multiple redirection"
echo "ls > out1 > out2" > shell-in
../shell < shell-in > shell-out 2>&1
${SHELL_BIN} < shell-in > shell-out 2>&1

grep "Ambiguous output redirect" shell-out
if [ $? -ne 0 ]
Expand Down
2 changes: 1 addition & 1 deletion test/test5 → test/script-tests/test5
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ rm -f csh-out shell-out
echo "Test5: 2 Pipes"
echo "cat file1.cc | grep malloc" > shell-in
/bin/sh < shell-in > csh-out
../shell < shell-in > shell-out
${SHELL_BIN} < shell-in > shell-out

diff shell-out csh-out
if [ $? -ne 0 ]
Expand Down
2 changes: 1 addition & 1 deletion test/test6 → test/script-tests/test6
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ rm -f csh-out shell-out
echo "Test6: 3 Pipes"
echo "cat file1.cc | grep malloc | grep char" > shell-in
/bin/sh < shell-in > csh-out
../shell < shell-in > shell-out
${SHELL_BIN} < shell-in > shell-out

diff shell-out csh-out
if [ $? -ne 0 ]
Expand Down
Loading

0 comments on commit e3e59d0

Please sign in to comment.