[Gambas-user] gb.test

Christof Thalhofer chrisml at deganius.de
Sun Jan 5 11:20:08 CET 2020

Am 05.01.20 um 00:44 schrieb Benoît Minisini:

> Class.Stat() is implemented in 'gb.util'.
> When you write a component project, the components checked in the 
> "Components" tab are just the component loaded when you run the project.
> You must indicate that the component *depends* on 'gb.util' in the 
> "Information" tab, by clicking on the "Require" button.
> Component dependencies are not necessarily the same thing as components 
> needed to run the component project.
> For example a component may require any component that implements GUI, 
> and its project will use the 'gb.qt5' component for testing purpose.
> These dependencies are used by the IDE to statically create the list of 
> all components that will be loaded by the project at startup.
> Yes, the dependencies of a project are static, not dynamic. If the list 
> created by the IDE is incorrect, you will usually get "unknown class" 
> and/or "unknown symbol" errors at runtime.

Ok thank you. I tried for a while.

I wanted to use ClassStat to get nicer Classnames instead of just
uppercase. Even if in .component of gb.test stands "Requires=gb.util"
the testclasses cannot be found by ClassStat:

ClassStat says: "Class not found" when Unittest is called from inside
the project to be tested.

*But this is not the main problem.*

The main problem in my opinion is that Class.Load(sName) in
GetAllTestContainerNames only works if the testclasses are exported and
so these are visible and callable later on when the project is in
production. I don't like that.

There IMO we need a new form of class a la classname.test which is
handled by the interpreter/compiler in a different way.

My idea was, that not the IDE tests but the executable itself is able to
test itself when compiled with debugging symbols and called in a special

If you create and call unittesthelloworld.gambas you can see what I mean.

It creates the testresults as TAP which can processed later for example
with Tobi's harness in gb.test.tap and then displayed in different ways.

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/20200105/2cc96c8d/attachment.sig>

More information about the User mailing list