Updates master test script to match project directory structure.
[situare] / scripts / master_test_script.sh
index 10df1b4..781cfe0 100755 (executable)
@@ -23,34 +23,48 @@ if [ ! -e $FILE ]; then
     echo "# User: `whoami`                            #" >> tests_summary.txt
     echo "##########################################" >> tests_summary.txt
 fi  
+
 ##########################################################
 #First part: Execution of all tests                      #
 ##########################################################
-for component in "${MODULES[@]}"
+for component in "${MODULES[@]}" #Loop through components
 do
-  echo "Creating Qt project file for $component"
   cd $location/$component
-  qmake -project "CONFIG+=qtestlib"
-  echo "Creating make file for $component"
-  qmake
-  echo "Building tests for $component"
-  make
-  echo "Running tests for $component"
-  ./$component -o testreport_$component.txt
-  echo "Cleaning $component"
-  make clean
-  rm Makefile
-  rm $component
+  CASES=(`ls`) #List all test cases uner component directory
+  for unittest in "${CASES[@]}"
+  do
+    cd $location/$component/$unittest
+    if [ $component = "testMap" ]; then 
+       qmake
+    else 
+       qmake -project "CONFIG+=qtestlib"
+       echo "Creating make file for $component/$unittest"
+       qmake
+    fi
+    echo "Building tests for $component/$unittest"
+    make
+    echo "Running tests for $component/$unittest"
+    ./$unittest -o testreport_$component.txt
+    echo "Cleaning $unittest"
+    make clean
+    rm Makefile
+    rm $unittest
+  done
 done
 
 #########################################################
 # Second part: Extraction of results                   #
 #########################################################
 echo "Summarizing test results....." 
-for component in "${MODULES[@]}"
-do
-    cd $location/$component
-    echo "############# $component ################" >> $FILE
+for component in "${MODULES[@]}" #Loop through components
+do 
+  cd $location/$component
+  CASES=(`ls`) #List all test cases uner component directory
+  for unittests in "${CASES[@]}"
+  do
+    cd $location/$component/$unittests
+    echo "############# $component/$unittests ################" >> $FILE
     grep Totals *.txt >> $FILE
+  done
 done
 exit 0