-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature request: runtests @class
#12
Comments
Why not |
A few years ago, I posted some patches to do some of this: https://savannah.gnu.org/patch/?9220 Feel free to cherry pick if these still apply. |
Is there a reason why |
Good question... doctest seems to usually do the same thing for
I think the same distinction could apply for |
You might need it to disambiguate between running tests for the whole class, and running tests for just the constructor. If you have a class named |
Yeah, there was a similar discussion over at gnu-octave/octave-doctest#196, you might be interested in weighing in over there too. |
I posted a summary of my thinking based on that thread here I think the same logic would apply for regular tests. Which suggests there could be some "parse this object for tests" common code. |
I think I mostly agree, and think that the whole test selection logic (and command syntax) for doctest and this BIST stuff can probably be the same. My current thinking is that there are two layers of test discovery:
But then if you wanted to test just a single method or constructor from a class, you couldn't use the specifier -> files -> tests mapping, because you'd only want some selected tests from within a classdef file. So that's probably not the right design after all. |
Oh – can BISTs actually be associated with a particular method within a classdef file? All the ones I recall seeing just have all the tests in a block down at the bottom of the file. |
I think almost everything about Octave's classdef support is in flux. What is certainly true is that separate .m files specifying class methods can have their own tests associated with them. That is |
Ah, that makes sense. And that way, the 1 specifier -> 1 or more files -> all tests from those files mapping sequence works. |
This is in. It's in
You can also do Support for namespaces and dot-referencing of constructors or class methods is not supported yet.
As things stand now, |
Closing this as fixed since the basic mechanism is working. Adding a #49 for adding namespace support. |
Ha! I found a quick-and-dirty way to add namespace support. 3990564 |
I'd like to see
runtests
be the main driver. Soruntests @myclass
would run the tests in class@myclass
.Consider looking at Doctest:
https://github.com/catch22/octave-doctest/blob/master/inst/doctest.m
There we wanted
doctest thing
to DTRT:doctest my_fcn
worksdoctest @klass
worksdoctest octfile.oct
works (and is subtly different thandoctest octfile
.doctest dir
works recursively, possibly staying out ofprivate/
subdirs (I forgot).The text was updated successfully, but these errors were encountered: