Index: /issm/trunk-jpl/jenkins/pine_island-mac
===================================================================
--- /issm/trunk-jpl/jenkins/pine_island-mac	(revision 25188)
+++ /issm/trunk-jpl/jenkins/pine_island-mac	(revision 25189)
@@ -28,10 +28,4 @@
 '
 
-# Test suites
-MATLAB_TEST=1
-PYTHON_TEST=0
-JAVASCRIPT_TEST=0
-EXAMPLES_TEST=0
-
 #-------------------#
 # External Packages #
@@ -54,4 +48,10 @@
 #---------#
 
+# Test suites
+MATLAB_TEST=1
+PYTHON_TEST=0
+JAVASCRIPT_TEST=0
+EXAMPLES_TEST=0
+
 # Number of CPUs used in ISSM compilation
 #
@@ -71,4 +71,4 @@
 # - test701 is skipped because it uses full Stokes equations
 #
-MATLAB_NROPTIONS="'exclude',[435,701,702,703,IdFromString('Dakota')]"
+MATLAB_NROPTIONS="'exclude',[IdFromString('Dakota'),435,701,702,703]"
 PYTHON_NROPTIONS=""
Index: /issm/trunk-jpl/jenkins/pine_island-mac-dakota
===================================================================
--- /issm/trunk-jpl/jenkins/pine_island-mac-dakota	(revision 25188)
+++ /issm/trunk-jpl/jenkins/pine_island-mac-dakota	(revision 25189)
@@ -33,10 +33,4 @@
 '
 
-# Test suites
-MATLAB_TEST=1
-PYTHON_TEST=1
-JAVASCRIPT_TEST=0
-EXAMPLES_TEST=0
-
 #-------------------#
 # External Packages #
@@ -61,4 +55,10 @@
 # Testing #
 #---------#
+
+# Test suites
+MATLAB_TEST=1
+PYTHON_TEST=1
+JAVASCRIPT_TEST=0
+EXAMPLES_TEST=0
 
 # Number of CPUs used in ISSM compilation
Index: /issm/trunk-jpl/packagers/linux/package-issm-linux-binaries-solid_earth.sh
===================================================================
--- /issm/trunk-jpl/packagers/linux/package-issm-linux-binaries-solid_earth.sh	(revision 25188)
+++ /issm/trunk-jpl/packagers/linux/package-issm-linux-binaries-solid_earth.sh	(revision 25189)
@@ -9,5 +9,5 @@
 MATLAB_PATH="/usr/local/MATLAB/R2019b"
 PACKAGE="ISSM-Solid_Earth" # Name of directory to copy distributable files to
-PYTHON_NROPTIONS="--benchmark slr"
+PYTHON_NROPTIONS="--benchmark 'slr'"
 TARBALL_NAME="issm-linux-solid_earth"
 TARBALL="${TARBALL_NAME}.tar.gz"
Index: /issm/trunk-jpl/packagers/linux/package-issm-linux-binaries-with_dakota.sh
===================================================================
--- /issm/trunk-jpl/packagers/linux/package-issm-linux-binaries-with_dakota.sh	(revision 25188)
+++ /issm/trunk-jpl/packagers/linux/package-issm-linux-binaries-with_dakota.sh	(revision 25189)
@@ -6,8 +6,8 @@
 LIBGFORTRAN="/usr/lib/x86_64-linux-gnu/libgfortran.so.5.0.0" # Important that this is the library itself
 LIBGFORTRAN_DIST="${ISSM_DIR}/lib/libgfortran.so.5" # Important the file name matches the SONAME entry in the binaries and other shared libraries which link to it
-MATLAB_NROPTIONS="'id',[IdFromString('Dakota')]" # Exclude any tests with transient solutions that require a restart
+MATLAB_NROPTIONS="'id',[IdFromString('Dakota')]"
 MATLAB_PATH="/usr/local/MATLAB/R2019b"
 PACKAGE="ISSM" # Name of directory to copy distributable files to
-PYTHON_NROPTIONS="--include_name 'Dakota' --exclude 234 418 420" # Exclude any tests with transient solutions that require a restart
+PYTHON_NROPTIONS="--include_name 'Dakota' --exclude 234 418 420"
 TARBALL_NAME="issm-linux-with_dakota"
 TARBALL="${TARBALL_NAME}.tar.gz"
Index: /issm/trunk-jpl/packagers/linux/package-issm-linux-binaries.sh
===================================================================
--- /issm/trunk-jpl/packagers/linux/package-issm-linux-binaries.sh	(revision 25188)
+++ /issm/trunk-jpl/packagers/linux/package-issm-linux-binaries.sh	(revision 25189)
@@ -6,5 +6,5 @@
 LIBGFORTRAN="/usr/lib/x86_64-linux-gnu/libgfortran.so.5.0.0" # Important that this is the library itself
 LIBGFORTRAN_DIST="${ISSM_DIR}/lib/libgfortran.so.5" # Important the file name matches the SONAME entry in the binaries and other shared libraries which link to it
-MATLAB_NROPTIONS="'exclude',[IdFromString('Dakota'),125,126]" # Exclude Dakota tests and any tests with transient solutions that require a restart
+MATLAB_NROPTIONS="'exclude',[IdFromString('Dakota')]"
 MATLAB_PATH="/usr/local/MATLAB/R2019b"
 PACKAGE="ISSM" # Name of directory to copy distributable files to
Index: /issm/trunk-jpl/packagers/mac/package-issm-mac-binaries-with_dakota.sh
===================================================================
--- /issm/trunk-jpl/packagers/mac/package-issm-mac-binaries-with_dakota.sh	(revision 25188)
+++ /issm/trunk-jpl/packagers/mac/package-issm-mac-binaries-with_dakota.sh	(revision 25189)
@@ -4,8 +4,8 @@
 ## Constants
 #
-MATLAB_NROPTIONS="'id',[IdFromString('Dakota')],'exclude',[234,235,418,420,444,445]" # Exclude any tests with transient solutions that require a restart, and any tests that are excluded in the standard build
+MATLAB_NROPTIONS="'id',[IdFromString('Dakota')],'exclude',[234,235,418,420,444,445]"
 MATLAB_PATH="/Applications/MATLAB_R2018a.app"
 PACKAGE="ISSM" # Name of directory to copy distributable files to
-PYTHON_NROPTIONS="--include_name 'Dakota' --exclude 234 417 418 420 444 445" # Exclude any tests with transient solutions that require a restart
+PYTHON_NROPTIONS="--include_name 'Dakota' --exclude 234 417 418 420 444 445"
 TARBALL_NAME="issm-mac-with_dakota"
 TARBALL="${TARBALL_NAME}.tar.gz"
Index: /issm/trunk-jpl/packagers/mac/package-issm-mac-binaries.sh
===================================================================
--- /issm/trunk-jpl/packagers/mac/package-issm-mac-binaries.sh	(revision 25188)
+++ /issm/trunk-jpl/packagers/mac/package-issm-mac-binaries.sh	(revision 25189)
@@ -4,5 +4,5 @@
 ## Constants
 #
-MATLAB_NROPTIONS="'exclude',[IdFromString('Dakota'),125,126,435,701,702,703]" # Exclude Dakota tests, any tests with transient solutions that require a restart, and any tests that are excluded in the standard build
+MATLAB_NROPTIONS="'exclude',[IdFromString('Dakota'),435,701,702,703]"
 MATLAB_PATH="/Applications/MATLAB_R2018a.app"
 PACKAGE="ISSM" # Name of directory to copy distributable files to
Index: /issm/trunk-jpl/scripts/test-issm-linux-binaries-solid_earth.sh
===================================================================
--- /issm/trunk-jpl/scripts/test-issm-linux-binaries-solid_earth.sh	(revision 25189)
+++ /issm/trunk-jpl/scripts/test-issm-linux-binaries-solid_earth.sh	(revision 25189)
@@ -0,0 +1,82 @@
+#!/bin/bash
+
+# This script is intended to test binaries downloaded to a user-end machine.
+#
+# NOTE: Tarball must already exist in INSTALL_DIR
+#
+
+unset ISSM_DIR # Ensure that ISSM_DIR is not set in case we are running on a machine and user profile that sets it
+
+MATLAB_NROPTIONS="'benchmark','slr'"
+MATLAB_PATH="/usr/local/MATLAB/R2019b"
+INSTALL_DIR=~/Downloads
+PACKAGE_NAME="ISSM-Solid_Earth"
+PYTHON_NROPTIONS="--benchmark 'slr'"
+TARBALL_NAME="issm-linux-solid_earth"
+TARBALL="${TARBALL_NAME}.tar.gz"
+
+cd ${INSTALL_DIR}
+rm -rf ${PACKAGE_NAME}
+tar -zxvf ${TARBALL}
+cd ${PACKAGE_NAME}/test/NightlyRun
+
+# Check that MATLAB tests run
+echo "Running MATLAB tests"
+rm matlab.log 2> /dev/null
+
+# Run MATLAB tests redirecting output to logfile and suppressing output to console
+${MATLAB_PATH}/bin/matlab -nojvm -nosplash -r "try, addpath ../../bin; addpath ../../lib; runme(${MATLAB_NROPTIONS}); exit; catch me,fprintf('%s',getReport(me)); exit; end" -logfile matlab.log &> /dev/null
+
+# Check that MATLAB did not exit in error
+matlabExitCode=`echo $?`
+matlabExitedInError=`grep -E "Activation cannot proceed|license|Error" matlab.log | wc -l`
+
+if [[ ${matlabExitCode} -ne 0 || ${matlabExitedInError} -ne 0 ]]; then
+	echo "----------MATLAB exited in error!----------"
+	cat matlab.log
+	echo "-----------End of matlab.log-----------"
+	exit 1
+fi
+
+# Check that all MATLAB tests passed
+numMatlabTestsFailed=`cat matlab.log | grep -c -e "FAILED|ERROR"`
+
+if [[ ${numMatlabTestsFailed} -ne 0 ]]; then
+	echo "One or more MATLAB tests FAILED"
+	exit 1
+else
+	echo "All MATLAB tests PASSED"
+fi
+
+# Check that Python tests run
+echo "Running Python tests"
+
+export ISSM_DIR="${INSTALL_DIR}"
+export PATH="${PATH}:${ISSM_DIR}/bin"
+export PYTHONPATH="${ISSM_DIR}/scripts"
+export PYTHONSTARTUP="${PYTHONPATH}/devpath.py"
+export PYTHONUNBUFFERED=1 # We don't want Python to buffer output, otherwise issm.exe output is not captured
+
+rm python.log 2> /dev/null
+./runme.py ${PYTHON_NROPTIONS} &> python.log 2>&1
+
+# Check that Python did not exit in error
+pythonExitCode=`echo $?`
+pythonExitedInError=`grep -E "runme.py: error" python.log | wc -l`
+
+if [[ ${pythonExitCode} -ne 0 || ${pythonExitedInError} -ne 0 ]]; then
+	echo "----------Python exited in error!----------"
+	cat python.log
+	echo "-----------End of python.log-----------"
+	exit 1
+fi
+
+# Check that all Python tests passed
+numPythonTestsFailed=`cat python.log | grep -c -e "FAILED|ERROR"`
+
+if [[ ${numPythonTestsFailed} -ne 0 ]]; then
+	echo "One or more Python tests FAILED"
+	exit 1
+else
+	echo "All Python tests PASSED"
+fi
Index: /issm/trunk-jpl/scripts/test-issm-linux-binaries-with_dakota.sh
===================================================================
--- /issm/trunk-jpl/scripts/test-issm-linux-binaries-with_dakota.sh	(revision 25188)
+++ /issm/trunk-jpl/scripts/test-issm-linux-binaries-with_dakota.sh	(revision 25189)
@@ -6,15 +6,11 @@
 #
 
-MATLAB_NROPTIONS="'id',[IdFromString('Dakota')],'exclude',[234,235,243,244,250,417,420,444,445,701,702,703]"  # Exclude any tests with transient solutions that require a restart
+unset ISSM_DIR # Ensure that ISSM_DIR is not set in case we are running on a machine and user profile that sets it
+
+MATLAB_NROPTIONS="'id',[IdFromString('Dakota')]"
 MATLAB_PATH="/usr/local/MATLAB/R2019b"
 INSTALL_DIR=~/Downloads
 PACKAGE_NAME="ISSM"
-
-# Exclude any tests with transient solutions that require a restart
-#
-# NOTE:
-# - 418 fails with "malloc(): invalid next size (unsorted)""
-#
-PYTHON_NROPTIONS="--include_name 'Dakota' --exclude 234 235 243 244 250 417 418 420 444 445 701 702 703"
+PYTHON_NROPTIONS="--include_name 'Dakota' --exclude 234 418 420"
 TARBALL_NAME="issm-linux-with_dakota"
 TARBALL="${TARBALL_NAME}.tar.gz"
Index: /issm/trunk-jpl/scripts/test-issm-linux-binaries.sh
===================================================================
--- /issm/trunk-jpl/scripts/test-issm-linux-binaries.sh	(revision 25188)
+++ /issm/trunk-jpl/scripts/test-issm-linux-binaries.sh	(revision 25189)
@@ -6,5 +6,7 @@
 #
 
-MATLAB_NROPTIONS="'exclude',[IdFromString('Dakota'),125,126]" # Exclude Dakota tests and any tests with transient solutions that require a restart
+unset ISSM_DIR # Ensure that ISSM_DIR is not set in case we are running on a machine and user profile that sets it
+
+MATLAB_NROPTIONS="'exclude',[IdFromString('Dakota')]"
 MATLAB_PATH="/usr/local/MATLAB/R2019b"
 INSTALL_DIR=~/Downloads
Index: /issm/trunk-jpl/scripts/test-issm-mac-binaries-with_dakota.sh
===================================================================
--- /issm/trunk-jpl/scripts/test-issm-mac-binaries-with_dakota.sh	(revision 25188)
+++ /issm/trunk-jpl/scripts/test-issm-mac-binaries-with_dakota.sh	(revision 25189)
@@ -6,15 +6,11 @@
 #
 
-MATLAB_NROPTIONS="'id',[IdFromString('Dakota')],'exclude',[234,235,243,244,250,417,418,420,435,444,445,701,702,703]" # Regular test suite, plus any tests with transient solutions that require a restart
+unset ISSM_DIR # Ensure that ISSM_DIR is not set in case we are running on a machine and user profile that sets it
+
+MATLAB_NROPTIONS="'id',[IdFromString('Dakota')],'exclude',[234,235,418,420,444,445]"
 MATLAB_PATH="/Applications/MATLAB_R2019b.app"
 INSTALL_DIR=~/Downloads
 PACKAGE_NAME="ISSM"
-
-# Exclude any tests with transient solutions that require a restart
-#
-# NOTE:
-# - 418 fails with "malloc(): invalid next size (unsorted)""
-#
-PYTHON_NROPTIONS="--include_name 'Dakota' --exclude 234 235 243 244 250 417 418 420 435 444 445 701 702 703"
+PYTHON_NROPTIONS="--include_name 'Dakota' --exclude 234 417 418 420 444 445"
 TARBALL_NAME="issm-mac-with_dakota"
 TARBALL="${TARBALL_NAME}.tar.gz"
Index: /issm/trunk-jpl/scripts/test-issm-mac-binaries.sh
===================================================================
--- /issm/trunk-jpl/scripts/test-issm-mac-binaries.sh	(revision 25188)
+++ /issm/trunk-jpl/scripts/test-issm-mac-binaries.sh	(revision 25189)
@@ -6,5 +6,7 @@
 #
 
-MATLAB_NROPTIONS="'exclude',[IdFromString('Dakota'),125,126]" # Exclude Dakota tests and any tests with transient solutions that require a restart
+unset ISSM_DIR # Ensure that ISSM_DIR is not set in case we are running on a machine and user profile that sets it
+
+MATLAB_NROPTIONS="'exclude',[IdFromString('Dakota'),435,701,702,703]"
 MATLAB_PATH="/Applications/MATLAB_R2019b.app"
 INSTALL_DIR=~/Downloads
Index: /issm/trunk-jpl/src/m/coordsystems/epsg2proj.m
===================================================================
--- /issm/trunk-jpl/src/m/coordsystems/epsg2proj.m	(revision 25188)
+++ /issm/trunk-jpl/src/m/coordsystems/epsg2proj.m	(revision 25189)
@@ -19,5 +19,5 @@
 	version_major=str2num(r);
 
-	[s,r]=system(['gdalsrsinfo epsg:' num2str(epsg) ' | grep PROJ.4 | tr -d ''\n'' | sed ''s/PROJ.4 : //''']);
+	[s,r]=system(['gdalsrsinfo epsg:' num2str(epsg) ' | command grep PROJ.4 | tr -d ''\n'' | sed ''s/PROJ.4 : //''']);
 
 	if s~=0, 
Index: /issm/trunk-jpl/src/m/coordsystems/epsg2proj.py
===================================================================
--- /issm/trunk-jpl/src/m/coordsystems/epsg2proj.py	(revision 25188)
+++ /issm/trunk-jpl/src/m/coordsystems/epsg2proj.py	(revision 25189)
@@ -29,5 +29,5 @@
     version_major=int(outs)
 
-    subproc_args = shlex.split("gdalsrsinfo epsg:{} | grep PROJ.4 | tr -d '\n' | sed 's/PROJ.4 : //'".format(epsg))
+    subproc_args = shlex.split("gdalsrsinfo epsg:{} | command grep PROJ.4 | tr -d '\n' | sed 's/PROJ.4 : //'".format(epsg))
     subproc = subprocess.Popen(subproc_args, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
     outs, errs = subproc.communicate()
Index: /issm/trunk-jpl/src/m/coordsystems/gdalinfo.m
===================================================================
--- /issm/trunk-jpl/src/m/coordsystems/gdalinfo.m	(revision 25188)
+++ /issm/trunk-jpl/src/m/coordsystems/gdalinfo.m	(revision 25189)
@@ -8,5 +8,5 @@
 
 	%first, get pixel size: 
-	[s,r]=system(sprintf('gdalinfo %s | grep "Pixel Size"',imagename));
+	[s,r]=system(sprintf('gdalinfo %s | command grep "Pixel Size"',imagename));
 	if s, error('gdalinfo error message: could not run system command gdalinfo to find pixel size'); end
 	d=sscanf(r,'Pixel Size = (%g,%g)');
@@ -14,5 +14,5 @@
 
 	%get upper left: 
-	[s,r]=system(sprintf('gdalinfo %s | grep "Upper Left"',imagename));
+	[s,r]=system(sprintf('gdalinfo %s | command grep "Upper Left"',imagename));
 	if s, error('gdalinfo error message: could not run system command gdalinfo to find upper left'); end
 	d=sscanf(r,'Upper Left ( %g,%g) %s');
@@ -21,5 +21,5 @@
 	
 	%get lower right: 
-	[s,r]=system(sprintf('gdalinfo %s | grep "Lower Right"',imagename));
+	[s,r]=system(sprintf('gdalinfo %s | command grep "Lower Right"',imagename));
 	if s, error('gdalinfo error message: could not run system command gdalinfo to find lower right'); end
 	d=sscanf(r,'Lower Right ( %g,%g) %s');
@@ -28,5 +28,5 @@
 
 	%Size: 
-	[s,r]=system(sprintf('gdalinfo %s | grep "Size is"',imagename));
+	[s,r]=system(sprintf('gdalinfo %s | command grep "Size is"',imagename));
 	if s, error('gdalinfo error message: could not run system command gdalinfo to find size'); end
 	d=sscanf(r,'Size is %g, %g');
Index: /issm/trunk-jpl/src/m/coordsystems/gmtmaskparallel.m
===================================================================
--- /issm/trunk-jpl/src/m/coordsystems/gmtmaskparallel.m	(revision 25188)
+++ /issm/trunk-jpl/src/m/coordsystems/gmtmaskparallel.m	(revision 25189)
@@ -52,5 +52,5 @@
 
 	%concatenate: 
-	system('cat oce_vertices*.txt | grep -v Command | awk ''{printf("%s\n",$3);}''> vertices.txt');
+	system('cat oce_vertices*.txt | command grep -v Command | awk ''{printf("%s\n",$3);}''> vertices.txt');
 
 	%read the vertices.txt file and flag our mesh vertices on the continent
Index: /issm/trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.m
===================================================================
--- /issm/trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.m	(revision 25188)
+++ /issm/trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.m	(revision 25189)
@@ -16,5 +16,5 @@
 
 	% Get Gmsh version
-	[s,r]=system(['gmsh -info | grep ''Version'' | sed -e ''s/Version[[:blank:]]*:[[:blank:]]//'' | cut -d ''.'' -f1']);
+	[s,r]=system(['gmsh -info | command grep ''Version'' | sed -e ''s/Version[[:blank:]]*:[[:blank:]]//'' | cut -d ''.'' -f1']);
 	if s~=0,
 		error(r);
Index: /issm/trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.py
===================================================================
--- /issm/trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.py	(revision 25188)
+++ /issm/trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.py	(revision 25189)
@@ -26,5 +26,5 @@
 
     # Get Gmsh version
-    subproc_args = "gmsh -info | grep 'Version' | sed -e 's/Version[[:blank:]]*:[[:blank:]]//' | cut -d '.' -f1"
+    subproc_args = "gmsh -info | command grep 'Version' | sed -e 's/Version[[:blank:]]*:[[:blank:]]//' | cut -d '.' -f1"
     subproc = subprocess.Popen(subproc_args, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
     outs, errs = subproc.communicate()
Index: /issm/trunk-jpl/src/m/miscellaneous/converttopowerof2.m
===================================================================
--- /issm/trunk-jpl/src/m/miscellaneous/converttopowerof2.m	(revision 25188)
+++ /issm/trunk-jpl/src/m/miscellaneous/converttopowerof2.m	(revision 25189)
@@ -11,6 +11,6 @@
 
 	%figure out the size of the tiff
-	[status,width]=system(['tiffinfo ' tiffname ' 2>/dev/null | grep "Image Width" | awk ''{printf("%s\n",$3);}''']); 
-	[status,length]=system(['tiffinfo ' tiffname ' 2>/dev/null | grep "Image Width" | awk ''{printf("%s\n",$6);}''']);
+	[status,width]=system(['tiffinfo ' tiffname ' 2>/dev/null | command grep "Image Width" | awk ''{printf("%s\n",$3);}''']); 
+	[status,length]=system(['tiffinfo ' tiffname ' 2>/dev/null | command grep "Image Width" | awk ''{printf("%s\n",$6);}''']);
 	width=str2num(width); length=str2num(length);
 
Index: /issm/trunk-jpl/src/m/plot/googlemaps.m
===================================================================
--- /issm/trunk-jpl/src/m/plot/googlemaps.m	(revision 25188)
+++ /issm/trunk-jpl/src/m/plot/googlemaps.m	(revision 25189)
@@ -225,9 +225,9 @@
 
 %Put everything in model
-[status output]=system('gdalinfo temp2.tiff | grep "Upper Left"');
+[status output]=system('gdalinfo temp2.tiff | command grep "Upper Left"');
 ul = sscanf(output,'Upper Left  (%f, %f)');
-[status output]=system('gdalinfo temp2.tiff | grep "Lower Right"');
+[status output]=system('gdalinfo temp2.tiff | command grep "Lower Right"');
 lr = sscanf(output,'Lower Right (%f, %f)');
-[status output]=system('gdalinfo temp2.tiff | grep "Size is"');
+[status output]=system('gdalinfo temp2.tiff | command grep "Size is"');
 si = sscanf(output,'Size is %i, %i');
 x_m=linspace(ul(1),lr(1),si(1));
