[Gambas-user] Crash with latest version
Jussi Lahtinen
jussi.lahtinen at gmail.com
Thu Feb 11 19:14:08 CET 2021
On Thu, Feb 11, 2021 at 3:09 PM Christof Thalhofer <chrisml at deganius.de>
wrote:
> Am 11.02.21 um 01:02 schrieb Jussi Lahtinen:
>
> > I don't quite follow your explanation. Can you give me an example
> > project on how to use it?
> > I did not say that the test suite causes side-effects, I said it
> > prevents them from being exposed.
> >
> > The tester I have used (it has exposed a lot of bugs!) is in the
> > software farm with the name GambasTester.
> > I don't think it is translatable to the test suite as it has a very
> > different philosophy behind it.
> > I think your test suite is the best option for testing code you have
> > written with Gambas. And what I wrote is more like cumulative fuzzer
> output.
>
> Ok, I'll have a look at it.
>
> gb.test's main task is running and documentation of tests.
>
> gb.test handles and reports crashes. So if you want to crash Gambas and
> want to get reported that a specific crash "is good", gb.text is able to
> handle that and report it.
>
> For example you can see gb.test here, it's a Gambas project you can run
> independently on your machine. Its in the sources here:
>
> gambas3/main/lib/test/gb.test/
>
> https://gitlab.com/gambas/gambas/-/tree/master/main/lib/test/gb.test
>
> It has tests to test itself in the 'TestMyself' folder. You can play
> around with these. In the 'TCrashes' test module you find this (it will
> create a crash and the test will fail because of this):
>
> > Public Sub DoACrash()
> >
> > Dim a As Long
> >
> > 'This is a crash
> > a = 3 / 0
> >
> > End
>
> If you choose it with 'Shift-F4' and then run it with 'F4' gb.test will
> report for this special test:
>
> 'not ok 1 - TCrashes:DoACrash'
>
> But you can revert the output of gb.test (with Test.IntendedFailure) and
> say that there is an error if the crash does not happen!
>
> > Public Sub DoACrash()
> >
> > Dim a As Long
> >
> > Test.IntendedFailure()
> >
> > 'This is a crash
> > a = 3 / 0
> >
> > End
>
> Then gb.test reports:
>
> "ok 1 - TCrashes:DoACrash crashed with error 'Division by zero'"
>
> And if the crash does not happen (for instance if 'a = 3') then gb.test
> reports:
>
> 'not ok 1 - TCrashes:DoACrash'
>
> Alles Gute
>
> Christof Thalhofer
>
> --
> Dies ist keine Signatur
>
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>
By quick look this is just as I suspected. The tests are run as different
processes with Exec. Now if the test causes side-effects, they will
disappear with the closed process.
Thus I do not want to test the interpreter with this suite.
Jussi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20210211/118ad69d/attachment-0001.htm>
More information about the User
mailing list