% Script that calls all the unit tests.
% To run:
%
%  (1) Make sure your settings in MatMPI_Comm_settings.m
%      are correct for your system.
%
%  (2) Make sure the machines listed in machine.m are
%      are correct for your system
%
%  (3) Erase the HOST variable from your shell.
%
%  (4) Launch Matlab and type 'unit_test_all'
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% VERY VERY VERY IMPORTANT %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% For this script to work you must erase
% the HOST environment variable first, e.g.
% in csh or tsch type:
%
%  setenv HOST 
%
% If this won't work for you, then the
% first machine in your list *must* be different
% than the machine you call this command from.
% 

% Call machines script to set which machines
% we running on.

machines;

% Set initial status.
all_status = 'SUCCESS';

% Unit test all the scripts.
status = unit_test( 'xbasic', 4, cpus(1:2), 200, 20 );
if (strcmp(status,'FAIL'))
  all_status = 'FAIL';
end

status = unit_test( 'basic', 2, cpus(1:2), 200, 20 );
if (strcmp(status,'FAIL'))
  all_status = 'FAIL';
end

status = unit_test( 'multi_basic', 2, cpus(1:2), 200, 20 );
if (strcmp(status,'FAIL'))
  all_status = 'FAIL';
end

status = unit_test( 'probe', 2, cpus(1:2), 200, 20 );
if (strcmp(status,'FAIL'))
  all_status = 'FAIL';
end

status = unit_test( 'broadcast', 4, cpus(1:2), 200, 20 );
if (strcmp(status,'FAIL'))
  all_status = 'FAIL';
end

status = unit_test( 'basic_app', 4, cpus(1:2), 400, 20 );
if (strcmp(status,'FAIL'))
  all_status = 'FAIL';
end

status = unit_test( 'speedtest', 2, cpus(1:2), 400, 20 );
if (strcmp(status,'FAIL'))
  all_status = 'FAIL';
end

status = unit_test( 'blurimage', 4, cpus(1:2), 400, 20 );
if (strcmp(status,'FAIL'))
  all_status = 'FAIL';
end

disp(['All tests: ' all_status]);

