From 70392cd56f23bcd92c05a4e513533492f9e04038 Mon Sep 17 00:00:00 2001 From: Simon Schneegans Date: Sun, 28 Aug 2022 07:30:09 +0200 Subject: [PATCH] :wrench: Add doom tests --- src/Doom.js | 11 ++++++++--- tests/generate-references.sh | 1 + .../doom-close-gnome-wayland-nested-33.png | Bin 0 -> 247 bytes .../doom-close-gnome-wayland-nested-34.png | Bin 0 -> 261 bytes .../doom-close-gnome-wayland-nested-35.png | Bin 0 -> 261 bytes .../doom-close-gnome-wayland-nested-36.png | Bin 0 -> 196 bytes tests/references/doom-close-gnome-xsession-33.png | Bin 0 -> 247 bytes tests/references/doom-close-gnome-xsession-34.png | Bin 0 -> 282 bytes tests/references/doom-close-gnome-xsession-35.png | Bin 0 -> 282 bytes tests/references/doom-close-gnome-xsession-36.png | Bin 0 -> 215 bytes .../doom-open-gnome-wayland-nested-33.png | Bin 0 -> 402 bytes .../doom-open-gnome-wayland-nested-34.png | Bin 0 -> 397 bytes .../doom-open-gnome-wayland-nested-35.png | Bin 0 -> 397 bytes .../doom-open-gnome-wayland-nested-36.png | Bin 0 -> 314 bytes tests/references/doom-open-gnome-xsession-33.png | Bin 0 -> 402 bytes tests/references/doom-open-gnome-xsession-34.png | Bin 0 -> 375 bytes tests/references/doom-open-gnome-xsession-35.png | Bin 0 -> 375 bytes tests/references/doom-open-gnome-xsession-36.png | Bin 0 -> 368 bytes tests/run-test.sh | 1 + 19 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 tests/references/doom-close-gnome-wayland-nested-33.png create mode 100644 tests/references/doom-close-gnome-wayland-nested-34.png create mode 100644 tests/references/doom-close-gnome-wayland-nested-35.png create mode 100644 tests/references/doom-close-gnome-wayland-nested-36.png create mode 100644 tests/references/doom-close-gnome-xsession-33.png create mode 100644 tests/references/doom-close-gnome-xsession-34.png create mode 100644 tests/references/doom-close-gnome-xsession-35.png create mode 100644 tests/references/doom-close-gnome-xsession-36.png create mode 100644 tests/references/doom-open-gnome-wayland-nested-33.png create mode 100644 tests/references/doom-open-gnome-wayland-nested-34.png create mode 100644 tests/references/doom-open-gnome-wayland-nested-35.png create mode 100644 tests/references/doom-open-gnome-wayland-nested-36.png create mode 100644 tests/references/doom-open-gnome-xsession-33.png create mode 100644 tests/references/doom-open-gnome-xsession-34.png create mode 100644 tests/references/doom-open-gnome-xsession-35.png create mode 100644 tests/references/doom-open-gnome-xsession-36.png diff --git a/src/Doom.js b/src/Doom.js index e5d0855..de0e485 100644 --- a/src/Doom.js +++ b/src/Doom.js @@ -50,10 +50,15 @@ var Doom = class { // screen. This ensures that the melted window will not be cut off. let actorScale = 2.0 * Math.max(1.0, global.stage.height / actor.height); + // If we are currently performing integration test, nothing will be visible in the + // test images as the animation has passed the center of the window already. To + // fix this, we set the scales to a pretty high value when performing tests. + const testMode = settings.get_boolean('test-mode'); + // clang-format off - shader.set_uniform_float(shader._uActorScale, 1, [actorScale]); - shader.set_uniform_float(shader._uHorizontalScale, 1, [settings.get_double('doom-horizontal-scale')]); - shader.set_uniform_float(shader._uVerticalScale, 1, [settings.get_double('doom-vertical-scale')]); + shader.set_uniform_float(shader._uActorScale, 1, [testMode ? 1.0 : actorScale]); + shader.set_uniform_float(shader._uHorizontalScale, 1, [testMode ? 50.0 : settings.get_double('doom-horizontal-scale')]); + shader.set_uniform_float(shader._uVerticalScale, 1, [testMode ? 200.0 : settings.get_double('doom-vertical-scale')]); shader.set_uniform_float(shader._uPixelSize, 1, [settings.get_double('doom-pixel-size')]); // clang-format on }); diff --git a/tests/generate-references.sh b/tests/generate-references.sh index a17f463..7f00538 100755 --- a/tests/generate-references.sh +++ b/tests/generate-references.sh @@ -177,6 +177,7 @@ capture_effect "wisps" if [[ "${FEDORA_VERSION}" -gt 32 ]]; then capture_effect "apparition" + capture_effect "doom" fi if [[ "${FEDORA_VERSION}" -gt 33 ]]; then diff --git a/tests/references/doom-close-gnome-wayland-nested-33.png b/tests/references/doom-close-gnome-wayland-nested-33.png new file mode 100644 index 0000000000000000000000000000000000000000..eaf3116360b28aea92e3985ba905b316b23496a2 GIT binary patch literal 247 zcmeAS@N?(olHy`uVBq!ia0vp^DImNS%G|oWRD45bDP46hOx7_4S6Fo+k-*%fF5l#mGU32|kz>0q*GU@|It zaQD{zJ2&s$zOjAVmjD0%A6h$M2T%=TlDE4HyI5k!YamA;Inl3-fq}gNXs-nW19Klx z{(<#@qw9fkrk*a2ArXh)p5D&LV8Fqk5d7c%rudl&o;NxxOc#~T>{_H@>K!;`TB>%} krA;!ffm3F!*4XdOq@c)H94xgu4`={`r>mdKI;Vst04uLd%>V!Z literal 0 HcmV?d00001 diff --git a/tests/references/doom-close-gnome-wayland-nested-34.png b/tests/references/doom-close-gnome-wayland-nested-34.png new file mode 100644 index 0000000000000000000000000000000000000000..81df901d2c150d570d982bd47913915832469d5e GIT binary patch literal 261 zcmeAS@N?(olHy`uVBq!ia0vp^DImNS%G|oWRD45bDP46hOx7_4S6Fo+k-*%fF5l#mGU32|kz>3DeW_Jcb& z@87;Lb?TJrnwmQ|uKfT1|9W3;7f=mjlDE4HyI5k!YamA;Inl3-fq}gNXs-nW19Klx z{(<#@qw9fk&YmugArXh)o_1tpaA0wD6s=mR0esU|Eeg<>()n&#z&`e}74ADVe;9TEjbre1^>bP0l+XkKvXE71 literal 0 HcmV?d00001 diff --git a/tests/references/doom-close-gnome-wayland-nested-35.png b/tests/references/doom-close-gnome-wayland-nested-35.png new file mode 100644 index 0000000000000000000000000000000000000000..81df901d2c150d570d982bd47913915832469d5e GIT binary patch literal 261 zcmeAS@N?(olHy`uVBq!ia0vp^DImNS%G|oWRD45bDP46hOx7_4S6Fo+k-*%fF5l#mGU32|kz>3DeW_Jcb& z@87;Lb?TJrnwmQ|uKfT1|9W3;7f=mjlDE4HyI5k!YamA;Inl3-fq}gNXs-nW19Klx z{(<#@qw9fk&YmugArXh)o_1tpaA0wD6s=mR0esU|Eeg<>()n&#z&`e}74ADVe;9TEjbre1^>bP0l+XkKvXE71 literal 0 HcmV?d00001 diff --git a/tests/references/doom-close-gnome-wayland-nested-36.png b/tests/references/doom-close-gnome-wayland-nested-36.png new file mode 100644 index 0000000000000000000000000000000000000000..1845a2cdbb41cba4c98acc475e1426e7c1501ec4 GIT binary patch literal 196 zcmeAS@N?(olHy`uVBq!ia0vp^DIm14Ba#1H&(%P{RubhEf9thF1v;3|2E37{m+a>l&=v~@2IfAX`~&L)N7n=8L_A#_Lo7}wCrGd^ hP7vv73Uu&iU|_9aVAL$!`3ES^;OXk;vd$@?2>?y7FK7S& literal 0 HcmV?d00001 diff --git a/tests/references/doom-close-gnome-xsession-33.png b/tests/references/doom-close-gnome-xsession-33.png new file mode 100644 index 0000000000000000000000000000000000000000..eaf3116360b28aea92e3985ba905b316b23496a2 GIT binary patch literal 247 zcmeAS@N?(olHy`uVBq!ia0vp^DImNS%G|oWRD45bDP46hOx7_4S6Fo+k-*%fF5l#mGU32|kz>0q*GU@|It zaQD{zJ2&s$zOjAVmjD0%A6h$M2T%=TlDE4HyI5k!YamA;Inl3-fq}gNXs-nW19Klx z{(<#@qw9fkrk*a2ArXh)p5D&LV8Fqk5d7c%rudl&o;NxxOc#~T>{_H@>K!;`TB>%} krA;!ffm3F!*4XdOq@c)H94xgu4`={`r>mdKI;Vst04uLd%>V!Z literal 0 HcmV?d00001 diff --git a/tests/references/doom-close-gnome-xsession-34.png b/tests/references/doom-close-gnome-xsession-34.png new file mode 100644 index 0000000000000000000000000000000000000000..c9c5f315206e34deeed282288fd88154a076efff GIT binary patch literal 282 zcmeAS@N?(olHy`uVBq!ia0vp^DImNS%G|oWRD45bDP46hOx7_4S6Fo+k-*%fF5l#mPX32|kz>0q*K{Py+B z!+Wc=Mm*ySTEKE23l$e+rWju_8nHqD{Ls=Ug_*CxlHacvZJhO5VcaLOO V*<{u$vw)^Ec)I$ztaD0e0swxnUaSBB literal 0 HcmV?d00001 diff --git a/tests/references/doom-close-gnome-xsession-35.png b/tests/references/doom-close-gnome-xsession-35.png new file mode 100644 index 0000000000000000000000000000000000000000..c9c5f315206e34deeed282288fd88154a076efff GIT binary patch literal 282 zcmeAS@N?(olHy`uVBq!ia0vp^DImNS%G|oWRD45bDP46hOx7_4S6Fo+k-*%fF5l#mPX32|kz>0q*K{Py+B z!+Wc=Mm*ySTEKE23l$e+rWju_8nHqD{Ls=Ug_*CxlHacvZJhO5VcaLOO V*<{u$vw)^Ec)I$ztaD0e0swxnUaSBB literal 0 HcmV?d00001 diff --git a/tests/references/doom-close-gnome-xsession-36.png b/tests/references/doom-close-gnome-xsession-36.png new file mode 100644 index 0000000000000000000000000000000000000000..0d714f35f112e5a3ec1326abbd6921936b679b77 GIT binary patch literal 215 zcmeAS@N?(olHy`uVBq!ia0vp^DIm757#dm_7=8hT8eT9klo~KFyh>nTu$sZZAYL$MSD+10f-}G;#FfdW?an+uemJjk^Y9l|XW$Ul{`fdjrrS3kC+}KA`*q>jOvE1LagaT^vI^jwdG^ k;BsP?kZ?=IfE#!ij^#L%&hWo#0#wi7>FVdQ&MBb@0Pt`*n*aa+ literal 0 HcmV?d00001 diff --git a/tests/references/doom-open-gnome-wayland-nested-33.png b/tests/references/doom-open-gnome-wayland-nested-33.png new file mode 100644 index 0000000000000000000000000000000000000000..43209b0e0f106d7566e435a642bd62f9a1b6b84a GIT binary patch literal 402 zcmeAS@N?(olHy`uVBq!ia0vp^DIm14Ba#1H&(%P{RubhEf9thF1v;3|2E37{m+a>tLI+uensgH_f8$Pq|R^ebavU~d4r(1L-1xeqA+!1}<^^+360 zo-U3d8TZ~^zsuF+AmaLPqvqy%)7t;xy|ygUhmO2riCa@@Dr5OMmT%dXC0@B9Pftx> zv+dO8xu1&8ai-LI#QNXe75?;!M!Z3%%#?I@RwfV->a($4`E&Y5+oG^}u_7EGaAN<2 z)xX3lXWpGM{k9kj2&izp44L)Tc*&o;l{?=%I)Fgagxy^(HCnvPU@aa3n-14Ba#1H&(%P{RubhEf9thF1v;3|2E37{m+a>Ouh5h@~}MF-LXATQb_*Bs`3eOsqPM7u*|hg%lX@@&9enrKp@5HNkI4BH)%Fn z_AydFmq64!b2_)RyQ(WDwCj!t2MC;qIgz~nzCyH$ng9q)xbK=I`@fini{%ObM8Rg| WG?9O)ziWU_X7F_Nb6Mw<&;$UjU5;b` literal 0 HcmV?d00001 diff --git a/tests/references/doom-open-gnome-wayland-nested-35.png b/tests/references/doom-open-gnome-wayland-nested-35.png new file mode 100644 index 0000000000000000000000000000000000000000..3b1553446738017bd402e412035406be9bd3ff4d GIT binary patch literal 397 zcmeAS@N?(olHy`uVBq!ia0vp^DIm14Ba#1H&(%P{RubhEf9thF1v;3|2E37{m+a>Ouh5h@~}MF-LXATQb_*Bs`3eOsqPM7u*|hg%lX@@&9enrKp@5HNkI4BH)%Fn z_AydFmq64!b2_)RyQ(WDwCj!t2MC;qIgz~nzCyH$ng9q)xbK=I`@fini{%ObM8Rg| WG?9O)ziWU_X7F_Nb6Mw<&;$UjU5;b` literal 0 HcmV?d00001 diff --git a/tests/references/doom-open-gnome-wayland-nested-36.png b/tests/references/doom-open-gnome-wayland-nested-36.png new file mode 100644 index 0000000000000000000000000000000000000000..7051a46a6eff8b2fe0517cb35ad85c08d11d7630 GIT binary patch literal 314 zcmeAS@N?(olHy`uVBq!ia0vp^DImNS%G|oWRD45bDP46hOx7_4S6Fo+k-*%fF5l#mYa332`P>lc$v2a`?v z|NsAQ-n@DD?%n(M?=u+{G3lm#+foHIih(i7+uem(kjLi}kRyK>FVdQ&MBb@08Wr? A4FCWD literal 0 HcmV?d00001 diff --git a/tests/references/doom-open-gnome-xsession-33.png b/tests/references/doom-open-gnome-xsession-33.png new file mode 100644 index 0000000000000000000000000000000000000000..43209b0e0f106d7566e435a642bd62f9a1b6b84a GIT binary patch literal 402 zcmeAS@N?(olHy`uVBq!ia0vp^DIm14Ba#1H&(%P{RubhEf9thF1v;3|2E37{m+a>tLI+uensgH_f8$Pq|R^ebavU~d4r(1L-1xeqA+!1}<^^+360 zo-U3d8TZ~^zsuF+AmaLPqvqy%)7t;xy|ygUhmO2riCa@@Dr5OMmT%dXC0@B9Pftx> zv+dO8xu1&8ai-LI#QNXe75?;!M!Z3%%#?I@RwfV->a($4`E&Y5+oG^}u_7EGaAN<2 z)xX3lXWpGM{k9kj2&izp44L)Tc*&o;l{?=%I)Fgagxy^(HCnvPU@aa3n-NS%G|oWRD45bDP46hOx7_4S6Fo+k-*%fF5l+X?E32|kz>G=Que@RKn zvgON}tlPeQ{c`=%ISV^GMj3l1!+a*ImKif}JM$}RA8aSVw#oScx5AR>~&z^JO4nw%^y z&d$~rAi&}6Ei59!%PZQ#pwQjexOb1tnu?IqE5wYpu4rnJbcj;2vWjw6WQgR}?yz2! z3X)-CTVW94{p8HdVE3&(S&~#9FSOQ z2zR3n+hw8Z@9$Pj3)Ed4rE&St_jj^>x{7*wK+ZKLhP)6Xx0^?#mIB?%;OXk;vd$@? F2>=(md8_~c literal 0 HcmV?d00001 diff --git a/tests/references/doom-open-gnome-xsession-35.png b/tests/references/doom-open-gnome-xsession-35.png new file mode 100644 index 0000000000000000000000000000000000000000..9fee71aba10860bcbb2d49ac1a43d1f7c38f1cc8 GIT binary patch literal 375 zcmeAS@N?(olHy`uVBq!ia0vp^DImNS%G|oWRD45bDP46hOx7_4S6Fo+k-*%fF5l+X?E32|kz>G=Que@RKn zvgON}tlPeQ{c`=%ISV^GMj3l1!+a*ImKif}JM$}RA8aSVw#oScx5AR>~&z^JO4nw%^y z&d$~rAi&}6Ei59!%PZQ#pwQjexOb1tnu?IqE5wYpu4rnJbcj;2vWjw6WQgR}?yz2! z3X)-CTVW94{p8HdVE3&(S&~#9FSOQ z2zR3n+hw8Z@9$Pj3)Ed4rE&St_jj^>x{7*wK+ZKLhP)6Xx0^?#mIB?%;OXk;vd$@? F2>=(md8_~c literal 0 HcmV?d00001 diff --git a/tests/references/doom-open-gnome-xsession-36.png b/tests/references/doom-open-gnome-xsession-36.png new file mode 100644 index 0000000000000000000000000000000000000000..4163a20837fb44577a1881cca8fad39d641469c8 GIT binary patch literal 368 zcmeAS@N?(olHy`uVBq!ia0vp^DImNS%G|oWRD45bDP46hOx7_4S6Fo+k-*%fF5l+X?E332`Z|38yW$J@7W zfBpK!WSF;o`*tSN%D;dAGFjB!xpRlfvXRNE`NfMDOxCSTHtqTMmOTM#WK8mQcVXyY zmGuB}1diSy)-Q zZSBcgxPRJAWA(=u4{go53R3drdXq+iq=bawmV)>9Y*(d*oNmaTXj#k_$^HKB?!{4V zTX}YfF-~xD+ab2E{5{A3$*V>nRV&19Wim44E*0=pI48~obR>hPtDnm{r-UW|dSiZl literal 0 HcmV?d00001 diff --git a/tests/run-test.sh b/tests/run-test.sh index 7a3e1b8..4780fcc 100755 --- a/tests/run-test.sh +++ b/tests/run-test.sh @@ -206,6 +206,7 @@ test_effect "wisps" if [[ "${FEDORA_VERSION}" -gt 32 ]]; then test_effect "apparition" + test_effect "doom" fi if [[ "${FEDORA_VERSION}" -gt 33 ]]; then