[Gambas-user] JIT crash

Tobias Boege taboege at gmail.com
Thu Jan 10 23:35:45 CET 2019


On Thu, 10 Jan 2019, Benoît Minisini wrote:
> Le 10/01/2019 à 20:57, Jussi Lahtinen a écrit :
> > OK, I didn't get that far. I got to "mTest.Ploo2.0: #6: Type mismatch:
> > wanted Stream, got Void instead".
> > At mTest.2454 there must be some remains of some tests... I fixed it,
> > but I noticed that something has changed in the interpreter.
> > One test fails (function called TheLoop), because essentially for next
> > loop from 10 to 1 (step -1) continues with value 0.
> > 
> > See attachment.
> > 
> > 
> > Jussi
> > 
> 
> It would be cool and really useful if you could rewrite your test project
> and make it clean.
> 
> I suggest that:
> 
> - Each test must be written in a public function named TestXXXX in a module.
> This function must return a Boolean to tell if the test is OK.
> 
> - East test method must start by printing which test is done.
> 
> - You can have several tests stored in different modules. It will be
> pratical as some tests will have to share some private code.
> 
> - The main function will browse the symbols of all modules, and call all
> public methods whose name starts with "Test" in natural order
> (Test1...Test9, Test 10...). Then the return value of each method is tested.
> Then you can break immediately if the test fails, or just print a warning
> message and continues.
> 
> - At the end of the program, you write how many tests failes.
> 
> That way several people will be able to add tests to the project easily.
> 
> What do you think?
> 

I'm very much in favour of this motion. Elsewhere it is completely normal
to have an extensive, automated test suite for a programming language
which runs before any release. Every bug that you fix can be turned into
a regression test to make the test suite better.

In this context I want to mention that the gb.test project is still on
the table although I lacked the drive to pursue it in the last 7 months
(in favour of other programming projects -- it's not that I'm generally
lazy). The component in the identically named git branch currently only
implements the Test-anything protocol with a common subtests extension
and not the abstractions that Christof originally brought to the table,
but it can still be used right now, exactly as Benoît describes above,
to execute a bunch of tests which return Boolean. Any TAP processor,
like prove(1), can be used to observe the tests and report failures and
statistics. [ There are more fine-grained test methods in that component
than Boolean "ok" vs. "not ok", and those can add diagnostic messages
about why tests fail. ]

I mean: a neatly organised public Gambas test suite should be created
(and used before every release). Later, when gb.test is usable and has
the required tooling, I'd like to see it ported, but in the meantime
what Benoît suggests above is most likely the most adequate step forward.

Regards,
Tobi

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk


More information about the User mailing list