+++ /dev/null
-#!/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 #
-##########################################################
-clear
-echo "This is the master script for building and executing all automatic unit test."
-echo "As a final step, it creates summary report from all tests executed."
-##########################################################
-#Environment settings #
-##########################################################
-#Store all directory names to a list
-#Modify these paths to point to correct path
-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
- echo "# User: `whoami` #" >> tests_summary.txt
- 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 under component directory
- for unittest in "${CASES[@]}"
- do
- cd $location/$component/$unittest
- echo "Building tests for $component/$unittest"
- qmake
- 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[@]}" #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
-fi
-exit 0