[Gambas-user] New component gb.test

Christof Thalhofer chrisml at deganius.de
Wed May 23 13:58:00 CEST 2018


Am 23.05.2018 um 11:31 schrieb Benoît Minisini:
> Le 23/05/2018 à 08:24, Christof Thalhofer a écrit :
>>
>> I doubt that testing in separate multiple processes (one per test) is
>> even necessary. I think it disturbs flexibility and/or makes all much
>> more complicated. 
>>
> I think it *is* necessary to run tests in separate processes, even if it 
> is slower, because any test can have side effects that can disturb other 
> tests.

Ok ... yes ... I agree ... but it depends, so ... here is an example:

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

Scenario 1 runs:

Test()


Scenario 2 runs:

Test1(), Test2(), Test3(), ...


Scenario 3 runs just

Testx() from Scenario2


Scenario 4:

My most complicated tests have to create a complex environment, create a
database and tables and so on and then a couple of tests are running.

For that I create the environment (create database) once for all tests
and destroy it afterwards.

But for each test I create tables in the database, fill them with
testdata and delete them afterwards.

There runs:

Setup(),
 SetupEach(), Test1(), TeardownEach()
 SetupEach(), Test2(), TeardownEach()
 ...
Teardown()


Scenario 5:

Most of the time (mostly while developing) I want to run just one of the
tests of Scenario 4. Then there has to run:

Setup(), SetupEach(), Testx(), TeardownEach(), Teardown()

Because I do not want to wait 5 minutes for each run of all tests of
Scenario 4.

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

If we are able to run each scenario in a separate process, its up to the
author to separate the tests.

This is the sort of flexibility I found out that I need it in my daily
work with unittesting my code.

I do unittesting my code since a lot of years, t think about 2 years now
with Gambas.


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/8c62d1c6/attachment.sig>


More information about the User mailing list