Copied test script from master
authorJukka Saastamoinen <juksa@czc6303cj1.ixonos.local>
Tue, 13 Apr 2010 05:08:42 +0000 (08:08 +0300)
committerJukka Saastamoinen <juksa@czc6303cj1.ixonos.local>
Tue, 13 Apr 2010 05:08:42 +0000 (08:08 +0300)
scripts/master_test_script.sh [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index 52cc33a..0f80199
@@ -1,5 +1,8 @@
 #!/bin/bash
 
+if [$1 -eq ""]; then
+   echo "Usage of the script: ./master_test_script.sh destination_folder_for_test_reports tests_folder_location"
+else
 ##########################################################
 # This script is executed from /scripts directory        #
 # in situare project folder                              #
@@ -11,12 +14,16 @@ echo "As a final step, it creates summary report from all tests executed."
 #Environment settings                                   #
 ##########################################################
 #Store all directory names to a list
-MODULES=(`ls ../tests/`)
 #Modify these paths to point to correct path
-location=$HOME/situare/repository/situare/tests/
-FILE=$HOME/situare/repository/situare/reports/tests_summary.txt
-if [ ! -e $FILE ]; then
-    touch tests_summary.txt
+location=$2
+echo $location
+echo "Tests situate at: $location"
+
+TEST_REPORT=$1
+echo "Directory to store test report: $1"
+#cd $location
+if [ ! -e $1/tests_summary.txt ]; then
+    touch $1/tests_summary.txt
     echo "##########################################" >> tests_summary.txt
     echo "# Summary of unit tests executed         #" >> tests_summary.txt
     echo "# Date: `date`    #" >> tests_summary.txt
@@ -24,13 +31,23 @@ if [ ! -e $FILE ]; then
     echo "##########################################" >> tests_summary.txt
 fi  
 
+FILE=$1/tests_summary.txt
+cd $location
+MODULES=(`ls`)
+echo $MODULES
+
+for component in "${MODULES[@]}"
+do 
+  echo "Found test directory: $component"
+done
+
 ##########################################################
 #First part: Execution of all tests                      #
 ##########################################################
 for component in "${MODULES[@]}" #Loop through components
 do
   cd $location/$component
-  CASES=(`ls`) #List all test cases uner component directory
+  CASES=(`ls`) #List all test cases under component directory
   for unittest in "${CASES[@]}"
   do
     cd $location/$component/$unittest
@@ -61,4 +78,5 @@ do
     grep Totals *.txt >> $FILE
   done
 done
+fi
 exit 0