Correct script exit status

TE-567
This commit is contained in:
muhammad-ammar
2014-10-31 07:48:56 +00:00
parent 375a38c4e4
commit ac8c6d18ca
3 changed files with 45 additions and 22 deletions

44
scripts/run_unit_tests.sh Executable file
View File

@@ -0,0 +1,44 @@
#!/bin/sh
EXIT=0
store_exit_code() {
code=$?
if [ ${code} -ne 0 ]
then
EXIT=${code}
fi
}
echo 'Configuring jscover...'
mkdir -p jscover-dist && wget http://files.edx.org/testeng/JSCover-1.0.2.zip -P jscover-dist && unzip jscover-dist/JSCover-1.0.2.zip -d jscover-dist/ && cp jscover-dist/target/dist/JSCover-all.jar jscover-dist && export JSCOVER_JAR=$PWD/jscover-dist/JSCover-all.jar
store_exit_code
echo 'jscover configured'
paver test
store_exit_code
echo 'Collecting Coverage...'
paver coverage
store_exit_code
echo 'Coverage Collection Completed'
current_path=`pwd`
reports_path=${current_path}/reports
dest_path=${HOME}/results/${TDDIUM_SESSION_ID}/session/
unit_combined_rpt=${reports_path}/diff_coverage_combined.html
echo 'Copying '${unit_combined_rpt}' to '${dest_path}
cp -f ${unit_combined_rpt} ${dest_path}
store_exit_code
echo 'Copied '${unit_combined_rpt}
echo 'Merging unit coverage reports...'
python ./scripts/cov_merge.py unit && python ./scripts/metrics/publish.py
store_exit_code
echo 'Unit coverage reports merged'
exit ${EXIT}

View File

@@ -1,21 +0,0 @@
mkdir -p jscover-dist && wget http://files.edx.org/testeng/JSCover-1.0.2.zip -P jscover-dist && unzip jscover-dist/JSCover-1.0.2.zip -d jscover-dist/ && cp jscover-dist/target/dist/JSCover-all.jar jscover-dist && export JSCOVER_JAR=$PWD/jscover-dist/JSCover-all.jar && paver test
echo '******************************************************'
echo 'Collecting Coverage...'
paver coverage
echo 'Coverage Collection Completed'
current_path=`pwd`
reports_path=$current_path/reports
dest_path=$HOME/results/$TDDIUM_SESSION_ID/session/
unit_combined_rpt=$reports_path/diff_coverage_combined.html
echo 'Copying '$unit_combined_rpt' to '$dest_path
cp -f $unit_combined_rpt $dest_path
echo '******************************************************'