mirror of
https://github.com/zoriya/ash.git
synced 2026-06-07 20:20:40 +00:00
functional tests
This commit is contained in:
Executable
+25
@@ -0,0 +1,25 @@
|
||||
./my_tests.sh tests/test1
|
||||
./my_tests.sh tests/test2
|
||||
./my_tests.sh tests/test3
|
||||
./my_tests.sh tests/test4
|
||||
./my_tests.sh tests/test5
|
||||
./my_tests.sh tests/test6
|
||||
./my_tests.sh tests/test7
|
||||
./my_tests.sh tests/test8
|
||||
./my_tests.sh tests/test9
|
||||
./my_tests.sh tests/test10
|
||||
./my_tests.sh tests/test11
|
||||
./my_tests.sh tests/test12
|
||||
./my_tests.sh tests/test13
|
||||
./my_tests.sh tests/test14
|
||||
./my_tests.sh tests/test15
|
||||
./my_tests.sh tests/test16
|
||||
./my_tests.sh tests/test17
|
||||
./my_tests.sh tests/test18
|
||||
./my_tests.sh tests/test19
|
||||
./my_tests.sh tests/test20
|
||||
./my_tests.sh tests/test21
|
||||
./my_tests.sh tests/test22
|
||||
./my_tests.sh tests/test23
|
||||
./my_tests.sh tests/test24
|
||||
./my_tests.sh tests/test25
|
||||
Executable
+62
@@ -0,0 +1,62 @@
|
||||
#!/bin/sh
|
||||
|
||||
test_setup()
|
||||
{
|
||||
if [ -f "$fictest".setup ]
|
||||
then
|
||||
. "$fictest".setup
|
||||
fi
|
||||
}
|
||||
|
||||
test_unsetup()
|
||||
{
|
||||
if [ -f "$fictest".unsetup ]
|
||||
then
|
||||
. "$fictest".unsetup
|
||||
fi
|
||||
}
|
||||
|
||||
test_tcsh()
|
||||
{
|
||||
test_setup
|
||||
/bin/cat "$fictest" | /bin/tcsh -f 2>tcsh.result >tcsh.result
|
||||
test_unsetup
|
||||
}
|
||||
|
||||
test_42sh()
|
||||
{
|
||||
test_setup
|
||||
/bin/cat "$fictest" | ./42sh 2> 42sh.result >42sh.result
|
||||
test_unsetup
|
||||
}
|
||||
|
||||
|
||||
fictest="$1"
|
||||
echo "*** Launch $fictest ***"
|
||||
rm -f tcsh.result 42sh.result
|
||||
if [ ! -f "$fictest" ]
|
||||
then
|
||||
echo "Test $fictest not found !" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -f "42sh" ]
|
||||
then
|
||||
echo "42sh not found !" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -f "/bin/tcsh" ]
|
||||
then
|
||||
echo "tcsh not found !" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
(test_tcsh "$fictest")
|
||||
(test_42sh "$fictest")
|
||||
diff 42sh.result tcsh.result >/dev/null 2>/dev/null
|
||||
if [ $? -eq 0 ]
|
||||
then
|
||||
echo " => OK"
|
||||
exit 0
|
||||
else
|
||||
echo " => FAILED"
|
||||
exit 1
|
||||
fi
|
||||
@@ -0,0 +1,25 @@
|
||||
alias.c
|
||||
alias.o
|
||||
args.c
|
||||
args.o
|
||||
builtin
|
||||
env.c
|
||||
env.o
|
||||
execute.c
|
||||
execute.o
|
||||
free_env.c
|
||||
free_env.o
|
||||
glob.c
|
||||
glob.o
|
||||
key_bindings
|
||||
main.c
|
||||
main.o
|
||||
my_ncurses
|
||||
prompt.c
|
||||
prompt.o
|
||||
redirections
|
||||
shell.c
|
||||
shell.o
|
||||
signal.c
|
||||
signal.o
|
||||
utility
|
||||
@@ -0,0 +1,2 @@
|
||||
cd ..
|
||||
ls null; ls ok && ls; ls || ls -l; ls
|
||||
@@ -0,0 +1,4 @@
|
||||
cd ..
|
||||
alias history ls
|
||||
history -la
|
||||
unalias history
|
||||
@@ -0,0 +1 @@
|
||||
unalias && ls
|
||||
@@ -0,0 +1 @@
|
||||
unalias || ls ..
|
||||
@@ -0,0 +1,16 @@
|
||||
unalias ls
|
||||
alias ls cd
|
||||
alias
|
||||
ls ..
|
||||
unalias ls
|
||||
ls
|
||||
alias a a
|
||||
alias b b
|
||||
alias L L
|
||||
alias
|
||||
unalias b
|
||||
alias
|
||||
unalias a
|
||||
alias
|
||||
unalias L
|
||||
alias
|
||||
@@ -0,0 +1,4 @@
|
||||
alias ls cd ..
|
||||
alias | grep cd
|
||||
alias ls cd
|
||||
alias | grep cd
|
||||
@@ -0,0 +1,8 @@
|
||||
alias ls ls -l
|
||||
alias
|
||||
alias ls "ls -l"
|
||||
alias
|
||||
alias ls 'ls -l'
|
||||
alias
|
||||
alias ls ls\ -l
|
||||
alias
|
||||
@@ -0,0 +1 @@
|
||||
ls '
|
||||
@@ -0,0 +1,7 @@
|
||||
cd ../../..
|
||||
cd 'Semestre 2'
|
||||
ls; cd ..
|
||||
cd "Semestre 2"
|
||||
ls; cd ..
|
||||
cd Semestre\ 2
|
||||
ls
|
||||
@@ -0,0 +1 @@
|
||||
echo ok bye
|
||||
@@ -0,0 +1,2 @@
|
||||
setenv ok lol
|
||||
echo $ok bye
|
||||
@@ -0,0 +1,2 @@
|
||||
ls l && cd ok
|
||||
ls &&
|
||||
@@ -0,0 +1 @@
|
||||
echo \n
|
||||
@@ -0,0 +1 @@
|
||||
echo
|
||||
@@ -0,0 +1 @@
|
||||
echo "\n"
|
||||
@@ -0,0 +1 @@
|
||||
echo "$"
|
||||
@@ -0,0 +1,3 @@
|
||||
echo "\t"
|
||||
echo $
|
||||
echo $?
|
||||
@@ -0,0 +1,4 @@
|
||||
cd ..
|
||||
setenv a s
|
||||
setenv b rc
|
||||
ls $a$b
|
||||
@@ -0,0 +1,2 @@
|
||||
cd ..
|
||||
&& ls
|
||||
@@ -0,0 +1 @@
|
||||
ls ||
|
||||
@@ -0,0 +1 @@
|
||||
|| ls
|
||||
@@ -0,0 +1 @@
|
||||
||
|
||||
@@ -0,0 +1 @@
|
||||
&&
|
||||
@@ -0,0 +1,2 @@
|
||||
&&
|
||||
ls ; || ; &&; ls
|
||||
@@ -0,0 +1,8 @@
|
||||
alias a a
|
||||
alias b b
|
||||
alias L L
|
||||
alias
|
||||
alias ok bye
|
||||
alias a bye
|
||||
alias
|
||||
unalias ok;alias
|
||||
Reference in New Issue
Block a user