dirlist = {"utl","asm","tst","nls","prs","sbn"};
dir     = fileparts (mfilename ("fullpath"));

if (! exist (fullfile (dir, "inst"), "dir"))      
  ## Run this if the package is installed      
  for ii=1:length(dirlist)
    addpath (fullfile(dir,"..",dirlist{ii}),"-end")
  endfor
else
  ## Run this if we are testing the package is installed without installation
  for ii=1:length(dirlist)
    addpath (fullfile(dir,"inst",dirlist{ii}))
  endfor
endif

clear dirlist dir