[Gambas-user] Questions about gb.test and gb.test.tap
Christof Thalhofer
chrisml at deganius.de
Wed Feb 26 10:28:41 CET 2020
Am 26.02.20 um 00:20 schrieb Benoît Minisini:
> The problem is that only the interpreter can load the test modules.
> 'gb.test' can't, as they are not exported.
>
> So I was thinking that -t will receive the list of tests, and that the
> interpreter will load the needed test modules and pass them to 'gb.test'
> startup method.
gb.test already has the ability to iterate through all classes and is
able to orchestrate it by itself.
So if it could have access to an array with all classes in it that would
be fine. I can alter it so that it's main method call is:
1) Unittest(Tests as String) if there exists a (hidden?) global variable
which contains all loaded testclasses. Could this variable be like a
readonly property which loads it's content only if it is read?
2) I would like to keep gb.test's main method's name "Unittest", because
Test is a handy name if one wants to test other things inside the
project. Is that ok?
3) If we would hide the Unittest main method, would it prevent the
author from calling it from inside the project? I do not like the idea
very much because while programming I often use Unittest in a start
method and simply hit F5.
So that in future I could call sth like:
Unittest("testmodule1.testmethod3")
> I prefer a basic text format instead of JSON. For example, a list of
> "Class.Method" with "*" meaning everything.
I understand, so we keep the dependencies small. I'm fine with that.
The teststring could be like so:
"List:testmodule1,testmodule17.testmethodBlah,testmodule99"
For all:
"*"
"List:" is just a description of the format, maybe we want later
handover something other, like "Csv:..." or even "Json:..."
Alles Gute
Christof Thalhofer
--
Dies ist keine Signatur
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20200226/2de9c41c/attachment-0001.sig>
More information about the User
mailing list