0001 function success = test_matpower(verbose, exit_on_fail)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
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
0033 tests{end+1} = 't_test_fcns';
0034 tests{end+1} = 't_nested_struct_copy';
0035 tests{end+1} = 't_have_fcn';
0036 tests{end+1} = 't_feval_w_path';
0037 tests{end+1} = 't_mpoption';
0038 tests{end+1} = 't_loadcase';
0039 tests{end+1} = 't_ext2int2ext';
0040 tests{end+1} = 't_jacobian';
0041 tests{end+1} = 't_hessian';
0042 tests{end+1} = 't_margcost';
0043 tests{end+1} = 't_totcost';
0044 tests{end+1} = 't_modcost';
0045 tests{end+1} = 't_hasPQcap';
0046 tests{end+1} = 't_mplinsolve';
0047 tests{end+1} = 't_mips';
0048 tests{end+1} = 't_mips_pardiso';
0049 tests{end+1} = 't_qps_matpower';
0050 tests{end+1} = 't_miqps_matpower';
0051 tests{end+1} = 't_pf';
0052 tests{end+1} = 't_pf_radial';
0053 tests{end+1} = 't_cpf';
0054 tests{end+1} = 't_islands';
0055 tests{end+1} = 't_opf_model';
0056 tests{end+1} = 't_opf_model_legacy';
0057 tests{end+1} = 't_opf_default';
0058 if have_fcn('fmincon')
0059 tests{end+1} = 't_opf_fmincon';
0060 end
0061 if have_fcn('minopf')
0062 tests{end+1} = 't_opf_minopf';
0063 end
0064 tests{end+1} = 't_opf_mips';
0065 if have_fcn('pdipmopf')
0066 tests{end+1} = 't_opf_tspopf_pdipm';
0067 end
0068 if have_fcn('scpdipmopf')
0069 tests{end+1} = 't_opf_tspopf_scpdipm';
0070 end
0071 if have_fcn('tralmopf')
0072 tests{end+1} = 't_opf_tspopf_tralm';
0073 end
0074 if have_fcn('ipopt')
0075 tests{end+1} = 't_opf_ipopt';
0076 end
0077 if have_fcn('knitro')
0078 tests{end+1} = 't_opf_knitro';
0079 end
0080 if have_fcn('bpmpd')
0081 tests{end+1} = 't_opf_dc_bpmpd';
0082 end
0083 if have_fcn('clp')
0084 tests{end+1} = 't_opf_dc_clp';
0085 end
0086 if have_fcn('cplex')
0087 tests{end+1} = 't_opf_dc_cplex';
0088 end
0089 if have_fcn('glpk')
0090 tests{end+1} = 't_opf_dc_glpk';
0091 end
0092 if have_fcn('gurobi')
0093 tests{end+1} = 't_opf_dc_gurobi';
0094 end
0095 if have_fcn('ipopt')
0096 tests{end+1} = 't_opf_dc_ipopt';
0097 end
0098 tests{end+1} = 't_opf_dc_mips';
0099 tests{end+1} = 't_opf_dc_mips_sc';
0100 if have_fcn('mosek')
0101 tests{end+1} = 't_opf_dc_mosek';
0102 end
0103 if have_fcn('quadprog')
0104 tests{end+1} = 't_opf_dc_ot';
0105 end
0106 if have_fcn('sdp_pf')
0107 if have_fcn('mosek') || have_fcn('sdpt3') || have_fcn('sedumi')
0108 tests{end+1} = 't_opf_sdpopf';
0109 tests{end+1} = 't_insolvablepf';
0110 tests{end+1} = 't_insolvablepf_limitQ';
0111 tests{end+1} = 't_insolvablepfsos';
0112 tests{end+1} = 't_insolvablepfsos_limitQ';
0113 end
0114 tests{end+1} = 't_testglobalopt';
0115 end
0116 tests{end+1} = 't_opf_userfcns';
0117 tests{end+1} = 't_opf_softlims';
0118 tests{end+1} = 't_runopf_w_res';
0119 tests{end+1} = 't_dcline';
0120 tests{end+1} = 't_get_losses';
0121 tests{end+1} = 't_load2disp';
0122 tests{end+1} = 't_makePTDF';
0123 tests{end+1} = 't_makeLODF';
0124 tests{end+1} = 't_printpf';
0125 tests{end+1} = 't_vdep_load';
0126 tests{end+1} = 't_total_load';
0127 tests{end+1} = 't_scale_load';
0128 tests{end+1} = 't_apply_changes';
0129 tests{end+1} = 't_psse';
0130
0131
0132 if have_fcn('smartmarket')
0133 tests{end+1} = 't_off2case';
0134 if have_fcn('minopf')
0135 tests{end+1} = 't_auction_minopf';
0136 end
0137 tests{end+1} = 't_auction_mips';
0138 if have_fcn('pdipmopf')
0139 tests{end+1} = 't_auction_tspopf_pdipm';
0140 end
0141 tests{end+1} = 't_runmarket';
0142 end
0143
0144
0145 all_ok = t_run_tests( tests, verbose );
0146
0147
0148 if exit_on_fail && ~all_ok
0149 exit(1);
0150 end
0151 if nargout
0152 success = all_ok;
0153 end