New presentation and organization
This commit is contained in:
parent
018bae577a
commit
9731ba9a7a
24 changed files with 73 additions and 189 deletions
77
tests/run.sh
Normal file
77
tests/run.sh
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
#!/bin/sh
|
||||
|
||||
###########################################
|
||||
# PIERRE PAGNOUX EXPERIENCE TESTSUITE #
|
||||
###########################################
|
||||
|
||||
#----------------- COLOR -----------------#
|
||||
# 0 - No style | 1 - Bold
|
||||
RED="\e[0;31m"
|
||||
BRED="\e[1;31m"
|
||||
GRN="\e[0;32m"
|
||||
BGRN="\e[1;32m"
|
||||
YEL="\e[0;33m"
|
||||
BYEL="\e[1;33m"
|
||||
BLU="\e[0;34m"
|
||||
BBLU="\e[1;34m"
|
||||
PUR="\e[0;35m"
|
||||
BPUR="\e[1;35m"
|
||||
CYA="\e[0;36m"
|
||||
BCYA="\e[1;36m"
|
||||
WHI="\e[0;37m"
|
||||
BWHI="\e[1;37m"
|
||||
GRE="\e[2;37m"
|
||||
|
||||
#----------------- GLOBV -----------------#
|
||||
ref_out=/tmp/ref_out.out
|
||||
my_out=/tmp/my_out.out
|
||||
|
||||
#----------------- TESTS -----------------#
|
||||
|
||||
tit_wrap()
|
||||
{
|
||||
echo -e $@$WHI
|
||||
}
|
||||
|
||||
func_test()
|
||||
{
|
||||
tit_wrap - $PUR $1
|
||||
shift
|
||||
printf $@ > $ref_out
|
||||
../../tinyprintf $@ > $my_out
|
||||
|
||||
diff $ref_out $my_out > /tmp/null
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
tit_wrap $GRN GOOD
|
||||
else
|
||||
tit_wrap $RED EXPECTED: $BRED$(cat $ref_out) \|$RED GOT: $BRED$(cat $my_out)
|
||||
fi
|
||||
}
|
||||
|
||||
func_file()
|
||||
{
|
||||
for file in *; do
|
||||
if [ -f $file ]; then
|
||||
func_test $file $(cat $file)
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
func_dir()
|
||||
{
|
||||
cd tests
|
||||
for dir in *; do
|
||||
if [ -d $dir ]; then
|
||||
tit_wrap == $dir ==
|
||||
cd $dir
|
||||
func_file
|
||||
cd ..
|
||||
fi
|
||||
done
|
||||
cd ..
|
||||
}
|
||||
|
||||
# func_dir
|
||||
|
||||
echo "Tests should be here"
|
||||
Loading…
Add table
Add a link
Reference in a new issue