check cmake scripts of tests, examples and demos exist

This commit is contained in:
Sébastien Loriot 2016-09-08 00:47:39 +02:00
parent de8d0d33f5
commit 1b9fb0be94
1 changed files with 16 additions and 6 deletions

View File

@ -82,23 +82,33 @@ else
echo 'No new files.'
fi
project_name_tests=$(for i in */test/*/CMakeLists.txt; do pkg=$(echo $i | awk -F "/" '{print $3}'); grep ${pkg}_Tests -L $i; done)
project_name_examples=$(for i in */examples/*/CMakeLists.txt; do pkg=$(echo $i | awk -F "/" '{print $3}'); grep ${pkg}_Examples -L $i; done)
project_name_demo=$(for i in */demo/*/CMakeLists.txt; do pkg=$(echo $i | awk -F "/" '{print $3}'); grep ${pkg}_Demo -L $i; done)
#check cmake scripts of tests, examples are present
for i in `ls -d */examples/*/ */test/*/`; do
if ! [ -f $i/CMakeLists.txt ]; then
echo "Error: $i/CMakeLists.txt does not exist!"
exit 1
fi
done
if [ -n "${project_name_tests}" ]; do
# check project in cmake scripts is correct
project_name_tests=$(for i in */test/*/CMakeLists.txt; do pkg=$(echo $i | awk -F "/" '{print $3}'); egrep "${pkg}_Tests\s*\)" -L $i; done)
project_name_examples=$(for i in */examples/*/CMakeLists.txt; do pkg=$(echo $i | awk -F "/" '{print $3}'); egrep "${pkg}_Examples\s*\)" -L $i; done)
project_name_demo=$(for i in */demo/*/CMakeLists.txt; do pkg=$(echo $i | awk -F "/" '{print $3}'); egrep "${pkg}_Demo\s*\)" -L $i; done)
if [ -n "${project_name_tests}" ]; then
echo "CMakeLists with incorrect project name"
echo ${project_name_tests}
exit 1
fi
if [ -n "${project_name_examples}" ]; do
if [ -n "${project_name_examples}" ]; then
echo "CMakeLists with incorrect project name"
echo ${project_name_examples}
exit 1
fi
if [ -n "${project_name_demo}" ]; do
if [ -n "${project_name_demo}" ]; then
echo "CMakeLists with incorrect project name"
echo ${project_name_demo}
exit 1