[Gambas-user] gb.test

Tobias Boege taboege at gmail.com
Sun Feb 23 17:16:24 CET 2020


On Sun, 23 Feb 2020, Christof Thalhofer wrote:
> If you want to join – my idea was like that: [...]
> 
> ---------------------------------------------------------------
> 
> 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 only thing I can do is to fix up and commit my gb.test.tap component,
which provides you with TAP printing and parsing classes. There is nothing
in there for organizing and running tests, it just deals with the TAP text
format and protocol. With it you can factor out TAP printing from the
tests and the parsing from your gbt3 harness or a potential future IDE
harness which does green/gray/red LED toggling. In any case, it is just
an implementation of both parties of a protocol in a reusable component,
independent of the act of testing Gambas projects (which is gb.test's
goal).

Looking at your code, the Assert.module is part of gb.test.tap, as it
converts runtime assertions into TAP, and your Track.module is part of
the TAP producer / consumer state as well (it seems to serve both parties
in gb.test). It would also affect every place in the code where you Print
some TAP inline, for example in UnitTest.class. So using the gb.test.tap
component would involve some refactoring of gb.test, which really just
consists of deleting code.

I haven't grokked yet how you implement fixtures and cherry-picking tests
to run, but I have a feeling that the common "subtests" extension, which
is implemented in gb.test.tap already, provides a way to model this nicely
with TAP -- namely by making each *test method* into its own subtest.
The test planner, which selects fixtures and test methods, can then even
print the correct "plan" line at the very beginning.

Those are the two things that have been on my mind about this. But first
things first. I'll put up a merge request for gb.test.tap as soon as the
last TODOs are eliminated, then we'll take it from there.

Regards,
Tobias

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20200223/7aabeab5/attachment.sig>


More information about the User mailing list