Mercurial > octave-antonio
comparison scripts/testfun/rundemos.m @ 18054:70e83c641b48
Accept a bare directory name for rundemos and runtests.
* rundemos.m, runtests.m: Use isdir to check whether input is a directory.
author | Rik <rik@octave.org> |
---|---|
date | Tue, 03 Dec 2013 09:35:54 -0800 |
parents | d63878346099 |
children | b675665ce328 |
comparison
equal
deleted
inserted
replaced
18053:7c9148b235eb | 18054:70e83c641b48 |
---|---|
36 dirs = ostrsplit (path (), pathsep ()); | 36 dirs = ostrsplit (path (), pathsep ()); |
37 do_class_dirs = true; | 37 do_class_dirs = true; |
38 elseif (nargin == 1) | 38 elseif (nargin == 1) |
39 if (is_absolute_filename (directory)) | 39 if (is_absolute_filename (directory)) |
40 dirs = {directory}; | 40 dirs = {directory}; |
41 elseif (is_rooted_relative_filename (directory)) | 41 elseif (isdir (directory)) |
42 dirs = {canonicalize_file_name(directory)}; | 42 dirs = {canonicalize_file_name(directory)}; |
43 else | 43 else |
44 if (directory(end) == filesep ()) | 44 if (directory(end) == filesep ()) |
45 directory = directory(1:end-1); | 45 directory = directory(1:end-1); |
46 endif | 46 endif |
47 fullname = find_dir_in_path (directory); | 47 fullname = find_dir_in_path (directory); |
48 if (! isempty (fullname)) | 48 if (isempty (fullname)) |
49 dirs = {fullname}; | |
50 else | |
51 error ("rundemos: DIRECTORY argument must be a valid pathname"); | 49 error ("rundemos: DIRECTORY argument must be a valid pathname"); |
52 endif | 50 endif |
51 dirs = {fullname}; | |
53 endif | 52 endif |
54 do_class_dirs = false; | 53 do_class_dirs = false; |
55 else | 54 else |
56 print_usage (); | 55 print_usage (); |
57 endif | 56 endif |