From 28dae90984b71d169f620da3d3fff2889a843462 Mon Sep 17 00:00:00 2001
From: Rohit Gupta <rohit.gupta@eurecom.fr>
Date: Mon, 21 Mar 2016 11:29:02 +0100
Subject: [PATCH] fix for excluding tests listed in xml file
---
.../autotests/run_exec_autotests.bash | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/cmake_targets/autotests/run_exec_autotests.bash b/cmake_targets/autotests/run_exec_autotests.bash
index a98a071bae..1029acc1e6 100755
--- a/cmake_targets/autotests/run_exec_autotests.bash
+++ b/cmake_targets/autotests/run_exec_autotests.bash
@@ -388,6 +388,7 @@ until [ -z "$1" ]
-g | --run-group)
RUN_GROUP=1
test_case_group=$2
+ test_case_group=`sed "s/\+/\*/g" <<< "${test_case_group}"` # Replace + with * for bash string substituion
echo_info "Will execute test cases only in group $test_case_group"
shift 2;;
-p)
@@ -423,9 +424,17 @@ rm -fr $tmpfile
xml_conf="$OPENAIR_DIR/cmake_targets/autotests/test_case_list.xml"
test_case_list=`xmlstarlet sel -T -t -m /testCaseList/testCase -s A:N:- "@id" -v "@id" -n $xml_conf`
+test_case_excl_list=`xmlstarlet sel -t -v "/testCaseList/TestCaseExclusionList" $xml_conf`
+echo "Test Case Exclusion List = $test_case_excl_list "
+
+test_case_excl_list=`sed "s/\+/\*/g" <<< "$test_case_excl_list" ` # Replace + with * for bash string substituion
+
+read -a test_case_excl_array <<< "$test_case_excl_list"
echo "test_case_list = $test_case_list"
+echo "Test Case Exclusion List = $test_case_excl_list \n"
+
readarray -t test_case_array <<<"$test_case_list"
read -a test_case_group_array <<< "$test_case_group"
@@ -447,6 +456,15 @@ for search_expr in "${test_case_array[@]}"
flag_run_test_case=1
fi
+ for search_excl in "${test_case_excl_array[@]}"
+ do
+ if [[ $search_expr == $search_excl ]];then
+ flag_run_test_case=0
+ echo_info "Test case $search_expr match found in test case excl group. Will skip the test case for execution..."
+ break
+ fi
+ done
+
#We skip this test case if it is not in the group list
if [ "$flag_run_test_case" -ne "1" ]; then
--
GitLab