Commit acb90a5d authored by Fabien Freling's avatar Fabien Freling
Browse files

Exclude some files during checking.

	* build-aux/check_source_has_test.sh: Exclude some files.

git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@3992 4aad255d-cdde-0310-9447-f3009e2ae8c0
parent d100e16e
2009-06-04 Fabien Freling <fabien.freling@lrde.epita.fr>
Exclude some files during checking.
* build-aux/check_source_has_test.sh: Exclude some files.
2009-06-04 Fabien Freling <fabien.freling@lrde.epita.fr> 2009-06-04 Fabien Freling <fabien.freling@lrde.epita.fr>
Add scrip shell for checking that each source has a test file. Add scrip shell for checking that each source has a test file.
......
...@@ -6,21 +6,30 @@ all_tests=0 ...@@ -6,21 +6,30 @@ all_tests=0
check_directory () check_directory ()
{ {
echo "Current directories: $1 $2" echo "Current directories: $1 $2"
for file in `ls $1`; do for file in `ls $1`; do
test_file=${file%.hh}.cc
if [ -f ${1}/$file ]; then if [ -f ${1}/$file ]; then
ext=${file##*.}
base=${file%.*}
if [ "$ext" = "hh" -a \
"${base##*.}" != "spe" ]; then
test_file=${file%.hh}.cc
all_tests=$(($all_tests + 1)) all_tests=$(($all_tests + 1))
if [ -f ${2}/$test_file ]; then if [ -f ${2}/$test_file ]; then
echo "\t\e[0;32mOK\e[m $file <-> $test_file" echo "\t\e[0;32mOK\e[m $file <-> $test_file" > /dev/null
else else
# FIXME: Manage exceptions.
if [ "$file" != "all.hh" -a \ if [ "$file" != "all.hh" -a \
"$file" != "essential.hh" ]; then "$file" != "essential.hh" ]; then
echo "\t\e[0;31mFAIL\e[m Test \"$test_file\" does not exist." echo "\tFAIL Test \"$test_file\" does not exist."
failed_tests=$(($failed_tests + 1)) failed_tests=$(($failed_tests + 1))
fi fi
fi fi
fi
fi fi
if [ -d ${1}/$file ]; then if [ -d ${1}/$file ]; then
...@@ -28,9 +37,8 @@ check_directory () ...@@ -28,9 +37,8 @@ check_directory ()
echo "" echo ""
check_directory ${1}/$file ${2}/$file check_directory ${1}/$file ${2}/$file
else else
# FIXME: Manage exceptions.
if [ "$file" != "internal" ]; then if [ "$file" != "internal" ]; then
echo "\e[0;31mFAIL\e[m Test directory \"${2}/$file\" does not exist." echo "FAIL Test directory \"${2}/$file\" does not exist."
fi fi
fi fi
fi fi
...@@ -58,5 +66,5 @@ else ...@@ -58,5 +66,5 @@ else
fi fi
echo "\n=====" echo "\n====="
echo "Uncorrect tests: $failed_tests" echo "Missing tests: $failed_tests"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment