% optiGTest toolbox L. LAURENT -- 16/05/2018 -- luc.laurent@lecnam.net
0001 %% optiGTest toolbox 0002 % L. LAURENT -- 16/05/2018 -- luc.laurent@lecnam.net 0003 0004 % sources available here: 0005 % https://bitbucket.org/luclaurent/optigtest/ 0006 % https://github.com/luclaurent/optigtest/ 0007 0008 % optiGTest - set of testing functions A toolbox to easy manipulate functions. 0009 % Copyright (C) 2018 Luc LAURENT <luc.laurent@lecnam.net> 0010 % 0011 % This program is free software: you can redistribute it and/or modify 0012 % it under the terms of the GNU General Public License as published by 0013 % the Free Software Foundation, either version 3 of the License, or 0014 % (at your option) any later version. 0015 % 0016 % This program is distributed in the hope that it will be useful, 0017 % but WITHOUT ANY WARRANTY; without even the implied warranty of 0018 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0019 % GNU General Public License for more details. 0020 % 0021 % You should have received a copy of the GNU General Public License 0022 % along with this program. If not, see <http://www.gnu.org/licenses/>. 0023 % 0024 0025 %% List all files of the optiGTest Toolbox 0026 % L. LAURENT -- 20/05/2018 -- luc.laurent@lecnam.net 0027 0028 0029 % To be executed at the root position of the toolbox 0030 0031 0032 function listF=listFilesoptiGTest(dirT) 0033 listF={}; 0034 %process all directories in the directory 'dirT' 0035 for ii=1:numel(dirT) 0036 %find files in directories 0037 fileDir=listFileDir(dirT{ii}); 0038 %add name of the directory 0039 fun=@(x) sprintf('%s/%s',dirT{ii},x); 0040 fileDirOk=cellfun(fun,fileDir,'UniformOutput',false); 0041 %add to the whole list 0042 listF={listF{:},fileDirOk{:}}; 0043 end 0044 %add the root directory of the Toolbox 0045 fileDirOk=listFileDir('.'); 0046 %add to the whole list 0047 listF={listF{:},fileDirOk{:}}; 0048 0049 0050 %Files to avoid 0051 blacklist={'.git',char(126),'m2html','.DS_Store',... 0052 'wiki','Figures','unConstrainedWiki.txt','docs','.nb'}; 0053 0054 for jj=1:numel(blacklist) 0055 %pattern to check 0056 checkF=blacklist{jj}; 0057 %seek the pattern 0058 kk=strfind(listF,checkF); 0059 if ~isempty(kk) 0060 %missing pattern 0061 hh=cellfun(@isempty,kk); 0062 %remove from the list 0063 IX=find(hh); 0064 listF={listF{IX}}; 0065 end 0066 end 0067 %manually addition 0068 %listF{end+1}='src/libs/PSOt/pso_Trelea_mod.m'; 0069 end 0070 0071 0072 % list files in a directory 0073 function [filDir]=listFileDir(dirM) 0074 %rawlist 0075 rawList=dir(dirM); 0076 %flag file 0077 flag_file=~[rawList.isdir]; 0078 %list of files in the directory 0079 filDir={rawList(flag_file).name}; 0080 end