TEST_MPTEST Run all MPTEST tests. TEST_MPTEST TEST_MPTEST(VERBOSE) TEST_MPTEST(VERBOSE, EXIT_ON_FAIL) SUCCESS = TEST_MPTEST(...) Runs all of the MPTEST tests. If VERBOSE is true (false by default), it prints the details of the individual tests. If EXIT_ON_FAIL is true (false by default), it will exit MATLAB or Octave with a status of 1 unless T_RUN_TESTS returns ALL_OK. See also T_RUN_TESTS.
0001 function success = test_mptest(verbose, exit_on_fail) 0002 %TEST_MPTEST Run all MPTEST tests. 0003 % TEST_MPTEST 0004 % TEST_MPTEST(VERBOSE) 0005 % TEST_MPTEST(VERBOSE, EXIT_ON_FAIL) 0006 % SUCCESS = TEST_MPTEST(...) 0007 % 0008 % Runs all of the MPTEST tests. If VERBOSE is true (false by default), 0009 % it prints the details of the individual tests. If EXIT_ON_FAIL is true 0010 % (false by default), it will exit MATLAB or Octave with a status of 1 0011 % unless T_RUN_TESTS returns ALL_OK. 0012 % 0013 % See also T_RUN_TESTS. 0014 0015 % MP-Test 0016 % Copyright (c) 2016, 2020, Power Systems Engineering Research Center (PSERC) 0017 % by Ray Zimmerman, PSERC Cornell 0018 % 0019 % This file is part of MP-Test. 0020 % Covered by the 3-clause BSD License (see LICENSE file for details). 0021 % See https://github.com/MATPOWER/mptest for more info. 0022 0023 if nargin < 2 0024 exit_on_fail = 0; 0025 if nargin < 1 0026 verbose = 0; 0027 end 0028 end 0029 0030 tests = {}; 0031 0032 %% MP-Test base test 0033 tests{end+1} = 't_test_fcns'; 0034 tests{end+1} = 't_have_feature'; 0035 0036 %% run the tests 0037 all_ok = t_run_tests( tests, verbose ); 0038 0039 %% handle success/failure 0040 if exit_on_fail && ~all_ok 0041 exit(1); 0042 end 0043 if nargout 0044 success = all_ok; 0045 end