[Gambas-user] Test Module, First try

Brian G brian at westwoodsvcs.com
Mon Jul 20 14:40:12 CEST 2020


Thanks, That was a great explanation of what happens when you remove a test module, Maybe that could be in the documentation?

Ok so your previous email talks about not monitoring string returned when testing for errors.
I am retrofitting the tests to a system which only returns string as errors, or raises and error when they happen.

If I want to test that the internal modules are returning the correct error in different situations, what would/should be the correct model to use when using the test harness to test this App. And I would like to emphasize check that the correct error is returned. 

Should the modules return an error code, then print the actual text thru another function in order to separate the module functionality from the displayed text? This would imply that it's difficult to throw errors anymore as error.raise does not seem to allow a code to be passed. I don't really understand how to re-implement error handling such that it will fit nicely with the test suite.

There are many more tests that need to be added to properly test the Apps functionality many of which will cause it to throw an error. if the app is correctly implemented there should be no random interpreter errors hopefully.

I would be happy for some input in this area regarding how you clearly see this working in a well implemented app within the test framework.

I had a great Sunday, I was off hiking in the mountains, did a 16 mile section of the high Sierra trail, so cool the whole thing is above 10,000 feet(3048 meters).  

Thank You
Brian G

----- Original Message -----
From: "Christof Thalhofer" <chrisml at deganius.de>
To: "Gambas mailing list" <user at lists.gambas-basic.org>
Sent: Sunday, July 19, 2020 2:37:59 AM
Subject: Re: [Gambas-user] Test Module, First try

Am 19.07.20 um 10:31 schrieb Brian G:

> I understand it should bail if a test disappears, It would be nice if it
> told you how to fix the issue when you really do want to delete a test.

> Like I had to hunt around, experiment to find a way to fix it. The
> default had to be reset.  By opening iand closing the test suite.

If I delete a testmodule with the name 'TcMMainFunctions' which I
defined to be called in a testsuite and then hit F4 the system says:

"Bail out! Cannot load class 'TcMMainFunctions'"

Yes, if I do not remember that I deleted 'TcMMainFunctions' this might
be confusing and I have a problem.

But: "Cannot load class" comes from the interpreter which crashed
because of that. The test system itself detects a crash of the
interpreter and reports that with "Bail out!" and the error message of
the interpreter.

There is no layer between it and the interpreter which does jobs the
interpreter has to do (for instance check the existence of classes or
report the non-existence). The reason is: This would add more complexity
and with that came more possibility for failures of the test system
itself. We want to keep it as stable and as concise as possible.

And btw. If you delete any class in a program which is called by another
part of your program and hit F5 the IDE says: "Cannot load class ...".
Here it is the same, the IDE reports the error message of the interpreter.

A testsuite can be seen as a program, which is defined by you  and has
to be executed. If it calls parts which do not exist the interpreter
crashes.

So at this point you might get a bit more familiar with it.

Alles Gute

Christof Thalhofer

-- 
Dies ist keine Signatur



----[ http://gambaswiki.org/wiki/doc/netiquette ]----


More information about the User mailing list