Closed mtmiller closed 5 years ago
Ok, this started with 91d8fe76e71a, which moves the new implementations in place, and apparently I now need to use runtests2 -dir inst
. Is that right and expected? If so, please go ahead and close this.
Is that right and expected?
Nope, that's a bug. I'll fix.
A bit more detail: the different functions for adding individual files, directories, and so on, are for Testify's internal use, to make execution paths more clear. The -dir
option to runtests2 is mostly for debugging so I can invoke it directly from the command line and see how it behaves. When you specify something without an explicit -dir
or other option, runtests2
is supposed to automatically detect what it is, and "do the right thing". The fact that it's erroring here means that add_target_auto
is calling the wrong function internally, which is a bug.
The problem was that the add_target_auto
was checking the target to see whether it is a file or directory, and doing this:
if ! isempty (canon_path) && exist (canon_path, "file")
this.add_file (canon_path, tag);
return
elseif ! isempty (canon_path) && exist (canon_path, "dir")
this.add_directory (canon_path, tag);
return
forgetting that directories also count as "file"
s.
I've fixed it by reversing the test order and doing the more-specific "dir"
test first. (You could also fix it by checking exist()
's return value code, or writing a more-specific exist_plain_file
function.)
Fix is checked in. This is an annoying enough bug that I'll roll a new point release, if you can confirm the fix works for you.
Yes, fix works perfectly
In testify 0.3.0, the following worked as expected when
inst
is a directory containing m-filesIn testify 0.3.2, an error is raised