cosmo run tests hdr

function did_pass=cosmo_run_tests(varargin)
% run unit and documentation tests
%
% did_pass=cosmo_run_tests(['verbose',v]['output',fn])
%
% Inputs:
%   '-verbose'        run with verbose output
%   '-logfile',fn     store output in a file named fn (optional, if omitted
%                     output is written to the terminal window)
%   'file.m'          run tests in 'file.m'
%   '-no_doc_test'    skip doctest
%   '-no_unit)test'   skip unittest
%
% Examples:
%   % run tests with defaults
%   cosmo_run_tests
%
%   % run with non-verbose output
%   cosmo_run_tests('verbose',false);
%
%   % explicitly set verbose output and store output in file
%   cosmo_run_tests('verbose',true,'output','~/mylogfile.txt');
%
% Notes:
%   - Doctest functionality was inspired by T. Smith.
%   - Unit tests can be run using MOxUnit by N.N. Oosterhof (2015-2017),
%           https://github.com/MOxUnit/MOxUnit
%   - Documentation tests can be run usxing MOdox by N.N. Oosterhof (2017),
%           https://github.com/MOdox/MOdox
%
% #   For CoSMoMVPA's copyright information and license terms,   #
% #   see the COPYING file distributed with CoSMoMVPA.           #