From ad44eb4fd7a654a043ea6acfb98b2333d1a7a000 Mon Sep 17 00:00:00 2001 From: ell <77150506+ellraiser@users.noreply.github.com> Date: Wed, 15 Nov 2023 19:32:39 +0000 Subject: [PATCH] more graphics class tests - added graphics.Canvas, graphics.Font, graphics.Image, graphics.Quad, graphics.Shader and graphics.Text - removed rogue resource img - removed event wait test placeholder - updated todo list --- testing/examples/lovetest_runAllTests.html | 2 +- testing/examples/lovetest_runAllTests.md | 40 +- testing/examples/lovetest_runAllTests.xml | 578 +++++++++--------- .../expected/love.test.graphics.Font-1.png | Bin 0 -> 102 bytes .../expected/love.test.graphics.Font-2.png | Bin 0 -> 104 bytes .../expected/love.test.graphics.Image-1.png | Bin 0 -> 375 bytes .../expected/love.test.graphics.Quad-1.png | Bin 0 -> 265 bytes .../expected/love.test.graphics.Shader-1.png | Bin 0 -> 114 bytes .../expected/love.test.graphics.Text-1.png | Bin 0 -> 449 bytes .../love.test.graphics.setColorMask-1.png | Bin 99 -> 84 bytes testing/readme.md | 30 +- testing/resources/font-letters-ab.png | Bin 0 -> 146 bytes testing/resources/font-letters-cd.png | Bin 0 -> 146 bytes .../love_test_graphics_rectangle_expected.png | Bin 135 -> 0 bytes testing/tests/event.lua | 2 +- testing/tests/graphics.lua | 359 ++++++++++- 16 files changed, 649 insertions(+), 362 deletions(-) create mode 100644 testing/output/expected/love.test.graphics.Font-1.png create mode 100644 testing/output/expected/love.test.graphics.Font-2.png create mode 100644 testing/output/expected/love.test.graphics.Image-1.png create mode 100644 testing/output/expected/love.test.graphics.Quad-1.png create mode 100644 testing/output/expected/love.test.graphics.Shader-1.png create mode 100644 testing/output/expected/love.test.graphics.Text-1.png create mode 100644 testing/resources/font-letters-ab.png create mode 100644 testing/resources/font-letters-cd.png delete mode 100644 testing/resources/love_test_graphics_rectangle_expected.png diff --git a/testing/examples/lovetest_runAllTests.html b/testing/examples/lovetest_runAllTests.html index 5a0be8304..41462203f 100644 --- a/testing/examples/lovetest_runAllTests.html +++ b/testing/examples/lovetest_runAllTests.html @@ -1 +1 @@ -

🔴 love.test



🔴 love.audio

\ No newline at end of file +

🔴 love.test



🟢 love.audio

\ No newline at end of file diff --git a/testing/examples/lovetest_runAllTests.md b/testing/examples/lovetest_runAllTests.md index c69865ba7..d309282ee 100644 --- a/testing/examples/lovetest_runAllTests.md +++ b/testing/examples/lovetest_runAllTests.md @@ -1,31 +1,31 @@ - + -**305** tests were completed in **16.781s** with **275** passed, **2** failed, and **28** skipped +**303** tests were completed in **13.278s** with **281** passed, **2** failed, and **20** skipped ### Report | Module | Pass | Fail | Skip | Time | | --------------------- | ------ | ------ | ------- | ------ | -| 🔴 audio | 27 | 1 | 0 | 4.898s | -| 🟢 data | 12 | 0 | 0 | 0.213s | -| 🟢 event | 4 | 0 | 2 | 0.103s | -| 🟢 filesystem | 29 | 0 | 2 | 0.561s | -| 🔴 font | 6 | 1 | 0 | 0.123s | -| 🟢 graphics | 93 | 0 | 14 | 2.106s | -| 🟢 image | 5 | 0 | 0 | 0.088s | -| 🟢 math | 20 | 0 | 0 | 0.284s | -| 🟢 physics | 22 | 0 | 6 | 0.059s | -| 🟢 sound | 4 | 0 | 0 | 0.015s | -| 🟢 system | 6 | 0 | 2 | 0.023s | -| 🟢 thread | 5 | 0 | 0 | 0.318s | -| 🟢 timer | 6 | 0 | 0 | 2.020s | -| 🟢 video | 2 | 0 | 0 | 0.016s | -| 🟢 window | 34 | 0 | 2 | 5.954s | +| 🟢 audio | 28 | 0 | 0 | 0.851s | +| 🟢 data | 12 | 0 | 0 | 0.197s | +| 🟢 event | 4 | 0 | 2 | 0.096s | +| 🟢 filesystem | 29 | 0 | 2 | 0.539s | +| 🔴 font | 6 | 1 | 0 | 0.121s | +| 🔴 graphics | 98 | 1 | 6 | 2.029s | +| 🟢 image | 5 | 0 | 0 | 0.087s | +| 🟢 math | 20 | 0 | 0 | 0.321s | +| 🟢 physics | 22 | 0 | 6 | 0.468s | +| 🟢 sound | 4 | 0 | 0 | 0.068s | +| 🟢 system | 6 | 0 | 2 | 0.148s | +| 🟢 thread | 5 | 0 | 0 | 0.376s | +| 🟢 timer | 6 | 0 | 0 | 2.082s | +| 🟢 video | 2 | 0 | 0 | 0.039s | +| 🟢 window | 34 | 0 | 2 | 5.855s | ### Failures -> 🔴 Source -> assert 53 [check effect was applied] expected 'true' got 'false' - > 🔴 GlyphData > assert 8 [check glyph number] expected '97' got '0' +> 🔴 Canvas +> assert 44 [check depth sample mode set] expected 'equal' got 'nil' + diff --git a/testing/examples/lovetest_runAllTests.xml b/testing/examples/lovetest_runAllTests.xml index deb2d4201..dc3bb5e04 100644 --- a/testing/examples/lovetest_runAllTests.xml +++ b/testing/examples/lovetest_runAllTests.xml @@ -1,162 +1,161 @@ - - - + + + - - assert 53 [check effect was applied] expected 'true' got 'false' + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - - + + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -166,507 +165,496 @@ - - + + assert 8 [check glyph number] expected '97' got '0' - + - + - + - + - - - + + + assert 44 [check depth sample mode set] expected 'equal' got 'nil' - - + - - + - + - + + + + + - + + + - - + - - + - - + - - - - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + - + - + - + - + - + - + - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - - + + - + - + - + - + - + - + - + - - + + - + - + - + - + - - + + - + - + - + - + - + - - + + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + \ No newline at end of file diff --git a/testing/output/expected/love.test.graphics.Font-1.png b/testing/output/expected/love.test.graphics.Font-1.png new file mode 100644 index 0000000000000000000000000000000000000000..cb2f21a1ed0ead98be5e0e43126476ea1846c3b6 GIT binary patch literal 102 zcmeAS@N?(olHy`uVBq!ia0vp^0wBx?BpA#)4xIr~OeH~n!3+##lh0ZJdGekvjv*Cu xk`ox3nb_L+*xJr9^Vo|>SjiidGlFz xshE?TkdUxpWnw`Q(?Tl==9Vmp2SI!sEDT3ZaCjzihCK&q@pScbS?83{1OW6x7uf&+ literal 0 HcmV?d00001 diff --git a/testing/output/expected/love.test.graphics.Image-1.png b/testing/output/expected/love.test.graphics.Image-1.png new file mode 100644 index 0000000000000000000000000000000000000000..5f45cf9e74d822c536be3082099ce09133192c72 GIT binary patch literal 375 zcmV--0f_#IP)RqEy~ItC z5mFp&z>Rw^VUMCxV1~#Pw?z6h2RKS3iW2EG!Kvd%{6aY~=F{WOhX9~w3vkj;0O)6W zfS&`Q5u1WUTnZBDQ;-ONMl6MfI0|P?NCZG5mcynA0Ivxc!hsmD5j(&N6K+h*@pp{( z2|W{Qyw7o8FfbA0zQ%}%g&1Q#H_S*T^7+Gz^fCk@Rtk@dSRJt)HFOkw4POU>kv0<&MCde85J3Ad;$JONIJ VNX|>^XKVlf002ovPDHLkV1i~FlZyZV literal 0 HcmV?d00001 diff --git a/testing/output/expected/love.test.graphics.Quad-1.png b/testing/output/expected/love.test.graphics.Quad-1.png new file mode 100644 index 0000000000000000000000000000000000000000..22ab17e3e15b1eaeb545971e015ac2e9d0edadc9 GIT binary patch literal 265 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0L3?#3!&-4XSJOMr-u0Z-)*!2JZ{|B$QGso=x z1R$TWB*-tA!Qt7BG$3cSr;B4q#hl)A2YHzk1>7FaKRm@Dvtk3w?~N?{)^gigma1?m zIEE!N=@(w#c~-na;jguu#|`F#91|xnG$yoocr-W|IH{;OC`c#@2_^XJD1SL}^?mW9 zXZ@BB_xW^o?^ZT+QdzRs(!qk&y7hfY^|ouL6xYapQp}NMSt0D>TPt@`c}=jBPY0)= z;vc75{5_nx9xD_-vN38c6fkmZ@X~1U5m+F^r6|0i+q~{PxAOiC+!_*D&Om1~c)I$z JtaD0e0su2hE&W+PDtS3O;u>(;Emnd#lgf->?i8DIiOG!q}9{a&t;uc GLK6UQNgGoD literal 0 HcmV?d00001 diff --git a/testing/output/expected/love.test.graphics.Text-1.png b/testing/output/expected/love.test.graphics.Text-1.png new file mode 100644 index 0000000000000000000000000000000000000000..4f15348cdffb4bef7adb7f461cb7aa263898fb36 GIT binary patch literal 449 zcmV;y0Y3hTP)g0{U)fQ71UQFBI6Q;wZG z0*wS!;pL=IpSs;{IOUo^RDpGDJ>WW&G!tEuuW*)dYu8e#o>y4220Gs@6BTxa2;CWE zsj0ddWU@b_5YP-d&zwbjj6?ltXt+sh2AYAINT_*OG%8gGIxl3sBz?BPqzsZEqbcMN rM=@@|tfwsc>4+=zl2Go(@jvSeY+*#a?9lLD00000NkvXXu0mjf!hyg) literal 0 HcmV?d00001 diff --git a/testing/output/expected/love.test.graphics.setColorMask-1.png b/testing/output/expected/love.test.graphics.setColorMask-1.png index 254f834f807f381374e51f249e36e74ffcdd595f..315c7a936f3dc201ea118e957e50a50e5f26b1f7 100644 GIT binary patch delta 65 zcmYcenIK`q$jrdNplX||1f-Y)d_r9R|7Ykr_Qe&*Eak-(VP6||NMvc%&ZNaLT4AV h^+*|H9Y`=@U`U$HEPMFm^IbrN44$rjF6*2UngH~68iN1; diff --git a/testing/readme.md b/testing/readme.md index 2f6f8bb42..9a56fe471 100644 --- a/testing/readme.md +++ b/testing/readme.md @@ -23,10 +23,10 @@ This is the status of all module tests currently. | ----------------- | ---- | ---- | ---- | | 🟢 audio | 28 | 0 | 0 | | 🟢 data | 12 | 0 | 0 | -| 🟡 event | 4 | 1 | 1 | -| 🟢 filesystem | 28 | 0 | 2 | +| 🟢 event | 4 | 0 | 2 | +| 🟢 filesystem | 29 | 0 | 2 | | 🟢 font | 7 | 0 | 0 | -| 🟡 graphics | 93 | 14 | 1 | +| 🟡 graphics | 99 | 5 | 1 | | 🟢 image | 5 | 0 | 0 | | 🟢 math | 20 | 0 | 0 | | 🟡 physics | 22 | 6 | 0 | @@ -113,24 +113,20 @@ For sanity-checking, if it's currently not covered or it's not possible to test Things still left to do: - [ ] physics.Body, physics.Contact, physics.Fixture, physics.Joint, physics.Shape, physics.World -- [ ] graphics.Canvas, graphics.Font, graphics.Image, graphics.Mesh, - graphics.ParticleSystem, graphics.Quad, graphics.Shader, - graphics.SpriteBatch, graphics.Text, graphics.Texture, graphics.Video -- [ ] event.wait -- [ ] graphics.present -- [ ] graphics.drawInstanced -- [ ] graphics.setDepthMode (needs actual graphical comparison if possible) -- [ ] graphics.setFrontFaceWinding (needs actual graphical comparison if possible) -- [ ] graphics.setMeshCullMode (needs actual graphical comparison if possible) -- [ ] @deprecated setStencilTest (use setStencilMode) - [ ] @deprecated physics methods (sasha changes) -- [ ] check 12.0 wiki page for new methods -- [ ] need a platform: format table somewhere for compressed formats (i.e. DXT not supported) -- [ ] ideally graphics.isCompressed should have an example of all compressed files love can take +- [ ] graphics.Mesh, graphics.ParticleSystem + graphics.SpriteBatch, graphics.Video +- [ ] graphics.drawInstanced +- [ ] @deprecated love.graphics.stencil (replaced by love.graphics.setStencilMode) +- [ ] @deprecated love.graphics.setStencilTest (replaced by love.graphics.setStencilMode) --- ## Future Goals -- [ ] Tests can compare visual results to a reference image (partially done) +- [ ] graphics.isCompressed should have an example of all compressed files love can take +- [ ] Tests can compare visual results to a reference image + This is partially done as we already save actual images for graphics tests to + use in the report output comparisons, so we just need to add a helper method + to the test class to let you just do assertMatching on the imgdata - [ ] Ability to test loading different combinations of modules - [ ] Performance tests diff --git a/testing/resources/font-letters-ab.png b/testing/resources/font-letters-ab.png new file mode 100644 index 0000000000000000000000000000000000000000..3ec8aeca38f5f5a67f9a3091b7cb5ab4a4fa8837 GIT binary patch literal 146 zcmeAS@N?(olHy`uVBq!ia0vp^LO{&L!3HFEdh;y=QjEnx?oJHr&dIz4a(p~p978lF zZk^;P#9+X}y!i3|_-m`PF37zJ6u#`hW8m1!_`;;h(&nP<{kd-Zg2u<97Db-)-@kIP u;iMm@x>6s%%y2fYS~yp5_l~@;eZ24cd6o0SkG%q#%i!ti=d#Wzp$P!pIx=Vg literal 0 HcmV?d00001 diff --git a/testing/resources/font-letters-cd.png b/testing/resources/font-letters-cd.png new file mode 100644 index 0000000000000000000000000000000000000000..51190f648e5fbb176adecc71974896b33a6ad867 GIT binary patch literal 146 zcmeAS@N?(olHy`uVBq!ia0vp^LO{&L!3HFEdh;y=QjEnx?oJHr&dIz4a(p~p978lF zUY%&j$DqK$-2L!>{IS3zVvk?+UQlMyX)yT0(hz-&Upe^gEq}@TPCjc)CrTy->zRIO tmiv(_@Ox51?b(hKeY!^Hx+X2NXKa1VE&otua|zH~22WQ%mvv4FO#r>iFv|b{ literal 0 HcmV?d00001 diff --git a/testing/resources/love_test_graphics_rectangle_expected.png b/testing/resources/love_test_graphics_rectangle_expected.png deleted file mode 100644 index bbbaf6edc47eb7d5a8fac65aa2688aff11068153..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 135 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|96eneLo9ml zPCm%TpupiIfA;_X)Lq;6q^$K_?;|kd(2PSY4W-+34zF0@%-wW?LHFs5+Drd+_ncPv iT=Tbyjb+uo&n(sUoQk=jADn=OF?hQAxvX