source: issm/trunk-jpl/packagers/linux/test-issm-linux-binaries.sh@ 25931

Last change on this file since 25931 was 25931, checked in by jdquinn, 4 years ago

CHG: Clean up

  • Property svn:executable set to *
File size: 1.5 KB
Line 
1#!/bin/bash
2
3# This script is intended to test binaries downloaded to a user-end machine.
4#
5# NOTE: Tarball must already exist in INSTALL_DIR
6#
7
8MATLAB_NROPTIONS="'exclude',[IdFromString('Dakota')]"
9MATLAB_PATH="/usr/local/MATLAB/R2019b"
10INSTALL_DIR=~/Downloads
11PACKAGE_NAME="ISSM"
12TARBALL_NAME="issm-linux"
13TARBALL="${TARBALL_NAME}.tar.gz"
14
15export ISSM_DIR="${INSTALL_DIR}/${PACKAGE_NAME}"
16export PATH="${PATH}:${ISSM_DIR}/bin:${ISSM_DIR}/scripts"
17
18cd ${INSTALL_DIR}
19rm -rf ${PACKAGE_NAME}
20tar -zxvf ${TARBALL}
21cd ${PACKAGE_NAME}/test/NightlyRun
22
23# Check that MATLAB tests run
24echo "Running MATLAB tests"
25rm matlab.log 2> /dev/null
26
27# Run MATLAB tests redirecting output to logfile and suppressing output to console
28${MATLAB_PATH}/bin/matlab -nosplash -nodesktop -nojvm -r "try, addpath ../../bin; addpath ../../lib; runme(${MATLAB_NROPTIONS}); exit; catch me,fprintf('%s',getReport(me)); exit; end" -logfile matlab.log &> /dev/null
29
30# Check that MATLAB did not exit in error
31matlabExitCode=`echo $?`
32matlabExitedInError=`grep -E "Activation cannot proceed|license|Error" matlab.log | wc -l`
33
34if [[ ${matlabExitCode} -ne 0 || ${matlabExitedInError} -ne 0 ]]; then
35 echo "----------MATLAB exited in error!----------"
36 cat matlab.log
37 echo "-----------End of matlab.log-----------"
38 exit 1
39fi
40
41# Check that all MATLAB tests passed
42numMatlabTestsFailed=`cat matlab.log | grep -c -e "FAILED|ERROR"`
43
44if [[ ${numMatlabTestsFailed} -ne 0 ]]; then
45 echo "One or more MATLAB tests FAILED"
46 exit 1
47else
48 echo "All MATLAB tests PASSED"
49fi
Note: See TracBrowser for help on using the repository browser.