Re: [hatari-devel] Hatari screen test

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Hi,

On 5/24/20 1:07 PM, Thomas Huth wrote:
Am Wed, 13 May 2020 19:34:09 +0200
schrieb Thomas Huth <th.huth@xxxxxxxxx>:

Am Wed, 13 May 2020 18:59:19 +0200
schrieb Nicolas Pomarède <npomarede@xxxxxxxxxxxx>:
[...]
it depends on the case, most of the time interpreting the results
means looking at the screen and  checking if some pixels are aligned
or in different colors (depending on which video test is performed),
which is not usable with natfeats.

We could maybe create a screenshot at the end and then compare if the
result is the same as a reference picture?

After finding an old fullscreen routine on my hard disk, I've now
implemented such a regression test: The program is run, then the test
script triggers a screenshot via the Hatari command fifo, and then the
screenshot is compared against a reference picture (using the
"identify" command from ImageMagick/GraphicsMagick). Please give it a
try, I hope it works in all environments (except SDL1 builds - screen-
shots are not possible here, I only get a black screen, but since we
plan to get rid of SDL1 anyway in the near future, I do not care too
much about testing that anymore).

Works fine for me.

NOTE: I tested the 0xFFFF820A register value
with a breakpoint, and that can be there much
before screen looks correct. Therefore I think
something like VBL wait would be more robust.

You can actually do the whole thing with
the debugger, now that I added "screenshot"
command to it:
	$hatari --parse debug.ini ...

----------- debugger.ini -----------
# parse screenshot.ini after 400 VBLs

breakpoint VBL > 400 :trace :file screenshot.ini

---------- screenshot.ini ----------
# take screenshot and quit Hatari

screenshot verify.png
quit
------------------------------------

(Quit flag is parsed in Hatari main loop.
Breakpoint ":trace" flag use avoids Hatari
stopping to debugger, so it gets back to
mainloop.)


Image comparison might also be slightly shorter
by using ImageMagick "compare" command instead
of "identify" one.


Btw. Would it be a lot of work to change this to
be a reset demo, as that would test a bit more
Hatari functionality?  :-)


	- Eero



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/