[Gambas-user] gb.test

Christof Thalhofer chrisml at deganius.de
Sun Feb 23 16:16:07 CET 2020


Hi Tobi!

Am 23.02.20 um 14:35 schrieb Tobias Boege:

> I'm not sure if this component already exists publicly somewhere and
> I am also out of the loop on Gambas testing, but what you two shared
> here the last few days sounds great!

Yes it looks like we're gonna get this thingi done now.

> As chance would have it, I'm on vacation right now and wrote a TAP
> producer in C++ a short while ago [1], so I'm familiar with the matter.
> I remember there were definitely-almost-finished TAP producer and
> consumer in my old gb.test fork, but I'm not sure if gb.test.tap
> exists yet. Did you find it somewhere? If not, I can get to work
> immediately.

This is strange, I have here gb.test.tap in one workdir under comp/src
but it not in master at Gitlab and if I want to push it, it is ignored
by Git but I cannot see, why!

Ahh, now I can see the reason.

The sources are deleted (???), but there are backupfiles with a trailing
"~".

I attach it as a Zip file. Let us all pray Google let it go through ... ;-)

There was also an old branch, look here:
https://gitlab.com/gambas/gambas/-/tree/gb.test

---------------------------------------------------------------

If you want to join – my idea was like that:

In the IDE one is able to define whether all tests should run or just
one testmodule with even just one testmethod will be used for testing
(this is important for test driven programming).

(If you need it, Unittest can deliver the arrays with the names for
that, there is code already written which creates these)

The user hits F4 and the code runs the same way as if F5 was hit, but
startup is altered to a (hidden?) module which calls

Unittest.Main(Optional TestModule, Optional TestMethod).

Breakpoints can be set so debugging can happen as usual.

After the test the original startup is restored.

If the test succeeded, there is a small green LED which lights up. If
the user clicks on it, the detailed results are shown (but normally
while programming this is not very interesting).

The LED turns grey as soon as code is altered.

If the test fails the LED lights up red and the test results are
displayed by the IDE in any way but can be closed or hidden fast with
the Esc key.

---------------------------------------------------------------

I myself currently try to write gbt3.gambas in app/src/gbt3, which will
be able to test a project at the commandline, prints out TAP and can be
used for automatic testing on deployment.

The idea here is that it injects a random named startmodule which let
all or some tests run and afterwards restores the original startclass.

Alles Gute

Christof Thalhofer

-- 
Dies ist keine Signatur
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gb.test.tap.zip
Type: application/zip
Size: 47160 bytes
Desc: not available
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20200223/140de141/attachment-0001.zip>
-------------- 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/20200223/140de141/attachment-0001.sig>


More information about the User mailing list