apjanke / octave-testify

New BIST (Built-In Self Test) functions for GNU Octave
GNU General Public License v3.0
4 stars 2 forks source link

feature request: runtests recurses into directories #11

Closed cbm755 closed 5 years ago

cbm755 commented 5 years ago

I'd like to see runtests be the main driver. A start would be having it recurse into directories by default.

mtmiller commented 5 years ago

:+1:, but why not test dir?

cbm755 commented 5 years ago

An honest answer: test scare me: its full of fid, logging, and stuff like that.

@apjanke: I wonder if this testify package should:

apjanke commented 5 years ago

That's a good idea. Testify has gotten big enough, especially with the addition of the Forge package tester, that it should be able to peacefully coexist with (and possibly interact with) Octave's own testing. I'll make the name changes.

apjanke commented 5 years ago

I renamed the functions in https://github.com/apjanke/octave-testify/commit/5defca4111fff6757440c67da23dab1c2bc7cde4 to avoid conflict with Octave's regular testing functions. They're now called test2, runtests2, and __run_test_suite2__, creatively enough. (I couldn't call the test function "testify", because that seems to conflict with the +testify namespace, and I'd rather keep the namespace name.)

apjanke commented 5 years ago

So, in terms of the main driver, I'd rather see both test2 and runtests2 hollowed out and have most of the actual testing logic moved into a testify.TestRunner class, so it can be managed and configured in a more structured manner. Then test2 and runtests2 can mostly worry about translating the command style function signatures into appropriate object configurations.

apjanke commented 5 years ago

Separate issue for renaming the top-level functions: #42. That part will go out in an 0.3.0 release that I'll make in the next couple days.

apjanke commented 5 years ago

An honest answer: test scare me: its full of fid, logging, and stuff like that.

I refactored the code to make it easier to work with (#45). The new code is in test2_refactor and runtests2_refactor. Now we can make behavior changes wherever it makes the most sense, without avoiding test.

apjanke commented 5 years ago

This is in. runtests2_refactor now recurses into subdirectories when you pass it a directory.

I made recursing the only behavior, not just the default, because I can't see a use case for not recursing. Octave source trees are typically not hierarchical once you get to a source directory. So the only reason you'd pass in a directory that is not an actual source directory is if you had source directories in its subdirs and you wanted to recurse. If I got this wrong, re-open this issue and I'll add a non-recursing option.