[Gambas-user] New component gb.test

Christof Thalhofer chrisml at deganius.de
Wed May 23 00:08:45 CEST 2018


Am 22.05.2018 um 16:51 schrieb Adrien Prokopowicz:
> Le 22/05/2018 à 10:57, Christof Thalhofer a écrit :
>> We should talk about the way how the code should be executed. Maybe we
>> need some magic here. Can (or should) we hand out the code to a separate
>> interpreter process? How?
> 
> Here's a flowchart of how I (ideally) view the different internal parts 
> interacting:
> 
>                                    +-----------+
> +--------------+      Starts      |           |
> |              | +--------------> |           |
> |  CI System   |                  |  gbtest3  | <--> CLI User
> |  Gambas IDE  |                  |           |
> |              | <--------------+ |           |
> +--------------+   Test Results   +-----------+
>                     (TAP stream)
>                                       +     ^
>                                       |     |  Returns test result
>                      Starts processes |     |  (Exit code)
>                         (gbx3 -s …)   |     |  (STDERR for errors)
>                                       v     +
> 
>                                 +------------------+
>                                 |-------------------+
>                                 ||                  |
>                                 ||   Test Methods   |
>                                 ||    (gb.test)     |
>                                 ++                  |
>                                  +------------------+
> 
> (The separation of gbtest3 aside, this flow is quite similar to Tobi's 
> implementation, but with some notable differences I'll cover here)
> 
> The needed magic resides in the "-s" flag of the interpreter (gbx3), 
> which sets a new startup class for running the project (different from 
> the MMain/FMain class set by the user).
> 
> We can set this flag to an hidden class exported by gb.test (for example 
> _TestRunner), which will run its Main() method directly, but in the 
> scope of the user's project. :-)
> 
>  From there, this hidden class can do two different things (dictated by 
> CLI arguments, sent by gbtest3).
> 
> First, walk through every class file in the hidden ".gambas" directory, 
> keep only the classes that inherit from TestModule/TestContainer (name 
> still up to bikeshedding, I prefer the first personally), then list all 
> the callable test methods. Then this list of tests is sent back to 
> gbtest3 to make the test plan before any test is run.

Please. Did you look at my code?

That does that all! Sigh ...

Grmbl. Noone looks at my code. Everyone of you wants to build up the
thingi from scratch. Why???

The only one who looked at the code was Benoît. And his mentions were
effective!

The Unittest is ready, done, works, selects testmethods out of
testclasses that inherit from Unittest, provides fixtures (creates
environment for each testmethod and destroys the environment afterwards
if needed). The tests are easy to write. I do it every day.

It tests a lot of my software since years. The only thing that has to be
done is:

Separate GUI and console in- and output. Bring it into Gambas so that
the tested project does not depend on the component gb.test or
gb.unittest as I named it. Refactoring.

I told where the problems lie and where the magic is needed but if noone
in this mailinglist looks at it it makes no sense for me at all to
discuss any further. Then I do the thing alone.

If one would like to help and bring ideas in, I appreciate that, but if
you want to write the same as I did from scratch but just in other words
with other naming without looking at that what I have done, I am out.

You are thinking the same thoughts I did, and you make the same errors I
did until it works (just like Tobi did). It costs you 4 weeks for
nothing, because it is done. If you do not look at it.

Sorry. I had a hard day today and my nerves are running out.

Alles Gute

Christof Thalhofer

-- 
Dies ist keine Signatur

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20180523/2689a87a/attachment-0001.sig>


More information about the User mailing list