[Gambas-user] JIT crash

Benoît Minisini g4mba5 at gmail.com
Thu Jan 10 23:01:00 CET 2019


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?

-- 
Benoît Minisini


More information about the User mailing list