From de8d0d33f56f261df15376d20f58ffcc3d98dfae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 8 Sep 2016 00:33:18 +0200 Subject: [PATCH] add test to check the field project in cmake scripts --- .../developer_scripts/test_merge_of_branch | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Scripts/developer_scripts/test_merge_of_branch b/Scripts/developer_scripts/test_merge_of_branch index 481be58f3ad..85d58127fe0 100755 --- a/Scripts/developer_scripts/test_merge_of_branch +++ b/Scripts/developer_scripts/test_merge_of_branch @@ -82,6 +82,28 @@ 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) + +if [ -n "${project_name_tests}" ]; do + echo "CMakeLists with incorrect project name" + echo ${project_name_tests} + exit 1 +fi + +if [ -n "${project_name_examples}" ]; do + echo "CMakeLists with incorrect project name" + echo ${project_name_examples} + exit 1 +fi + +if [ -n "${project_name_demo}" ]; do + echo "CMakeLists with incorrect project name" + echo ${project_name_demo} + exit 1 +fi + current_rev=$(${git} rev-parse HEAD) trap 'echo "(aborting the merge now)" && ${git} reset --quiet --hard ${current_rev}' EXIT