TEST_MP_OPT_MODEL Run all MP-Opt-Model tests. TEST_MP_OPT_MODEL TEST_MP_OPT_MODEL(VERBOSE) TEST_MP_OPT_MODEL(VERBOSE, EXIT_ON_FAIL) SUCCESS = TEST_MP_OPT_MODEL(...) Runs all of the MP-Opt-Model 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_mp_opt_model(verbose, exit_on_fail) 0002 %TEST_MP_OPT_MODEL Run all MP-Opt-Model tests. 0003 % TEST_MP_OPT_MODEL 0004 % TEST_MP_OPT_MODEL(VERBOSE) 0005 % TEST_MP_OPT_MODEL(VERBOSE, EXIT_ON_FAIL) 0006 % SUCCESS = TEST_MP_OPT_MODEL(...) 0007 % 0008 % Runs all of the MP-Opt-Model 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-Opt-Model 0016 % Copyright (c) 2004-2020, Power Systems Engineering Research Center (PSERC) 0017 % by Ray Zimmerman, PSERC Cornell 0018 % 0019 % This file is part of MP-Opt-Model. 0020 % Covered by the 3-clause BSD License (see LICENSE file for details). 0021 % See https://github.com/MATPOWER/mp-opt-model 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-Opt-Model tests 0033 tests{end+1} = 't_have_fcn'; 0034 tests{end+1} = 't_nested_struct_copy'; 0035 tests{end+1} = 't_nleqs_master'; 0036 tests{end+1} = 't_qps_master'; 0037 tests{end+1} = 't_miqps_master'; 0038 tests{end+1} = 't_nlps_master'; 0039 tests{end+1} = 't_opt_model'; 0040 tests{end+1} = 't_om_solve_leqs'; 0041 tests{end+1} = 't_om_solve_nleqs'; 0042 tests{end+1} = 't_om_solve_qps'; 0043 tests{end+1} = 't_om_solve_miqps'; 0044 tests{end+1} = 't_om_solve_nlps'; 0045 0046 %% run the tests 0047 all_ok = t_run_tests( tests, verbose ); 0048 0049 %% handle success/failure 0050 if exit_on_fail && ~all_ok 0051 exit(1); 0052 end 0053 if nargout 0054 success = all_ok; 0055 end