From b572a495d665008798ee821bee3d546fc0991340 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 6 Sep 2007 13:27:43 +0000 Subject: changed default test-behaviour: now every test has to return a result immediately (if it knows that it takes more time, it must return "-1" and the tester will wait for it; if it does not do so, the test automatically fails) svn path=/trunk/externals/zexy/; revision=8710 --- tests/testunit.pd | 105 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 63 insertions(+), 42 deletions(-) (limited to 'tests') diff --git a/tests/testunit.pd b/tests/testunit.pd index a9f35bb..ff70ba9 100644 --- a/tests/testunit.pd +++ b/tests/testunit.pd @@ -1,4 +1,4 @@ -#N canvas 850 122 312 252 10; +#N canvas 577 122 585 499 10; #N canvas 455 165 474 559 run-test 0; #X obj 71 136 symbol; #X obj 71 104 inlet test-to-run; @@ -32,43 +32,55 @@ #X obj 71 164 t b s s; #X text 99 217 start regression test; #X text 105 251 regression test finished; -#N canvas 649 180 525 641 get 0; -#X obj 106 116 r \$0-receive; -#X msg 155 280 0; -#X obj 106 239 del 0; -#X obj 106 310 f; -#X text 193 114 get the result; -#X text 145 235 we need a delay \, since the object's output triggers -the destruction of the object \; this would lead to stack corruption -if we do it immediately; -#X obj 131 358 outlet; -#X obj 123 26 inlet reset; -#X obj 106 336 t b f; -#X obj 106 175 spigot; -#X msg 161 154 1; -#X obj 106 197 t b f b; -#X msg 189 154 0; -#X obj 137 154 t f; -#X text 182 178 we only accept the 1st result of the test; -#X obj 123 48 t b b b; -#X obj 123 66 s \$0-send; -#X connect 0 0 9 0; -#X connect 1 0 3 1; -#X connect 2 0 3 0; -#X connect 3 0 8 0; -#X connect 7 0 15 0; -#X connect 8 0 10 0; -#X connect 8 1 6 0; -#X connect 9 0 11 0; -#X connect 10 0 13 0; -#X connect 11 0 2 0; -#X connect 11 1 3 1; -#X connect 11 2 12 0; -#X connect 12 0 13 0; -#X connect 13 0 9 1; -#X connect 15 0 16 0; -#X connect 15 1 1 0; -#X connect 15 2 10 0; +#N canvas 318 184 905 641 get 0; +#X obj 105 488 outlet; +#X obj 105 26 inlet reset; +#X obj 105 71 t b b b; +#X obj 162 229 spigot; +#X msg 228 229 1; +#X msg 258 229 0; +#X obj 202 229 t f; +#X obj 163 120 s \$0-send; +#X text 248 120 <- start the test; +#X text 250 168 <- test result; +#X obj 162 165 r \$0-receive; +#X obj 105 342 spigot; +#X obj 228 212 t b b; +#X msg 129 45 bang; +#X obj 162 260 select -1; +#X obj 105 401 t f b; +#X msg 162 278 0; +#X msg 105 316 0; +#X text 136 321 <--------------- fail as default; +#X text 228 262 <- "-1" indicates "wait for result"; +#X obj 105 430 t b f; +#X obj 105 446 del 0; +#X obj 105 462 f; +#X text 149 450 <--- buffering \, since we have to avoid that the object +triggers it's own destruction (stack corruption); +#X connect 1 0 2 0; +#X connect 2 0 17 0; +#X connect 2 1 7 0; +#X connect 2 2 12 0; +#X connect 3 0 14 0; +#X connect 4 0 6 0; +#X connect 5 0 6 0; +#X connect 6 0 3 1; +#X connect 6 0 11 1; +#X connect 10 0 3 0; +#X connect 11 0 15 0; +#X connect 12 0 4 0; +#X connect 13 0 2 0; +#X connect 14 0 16 0; +#X connect 14 1 15 0; +#X connect 15 0 20 0; +#X connect 15 1 5 0; +#X connect 16 0 11 1; +#X connect 17 0 11 0; +#X connect 20 0 21 0; +#X connect 20 1 22 1; +#X connect 21 0 22 0; +#X connect 22 0 0 0; #X restore 71 232 pd get result; #X text 64 17 the test MUST return a result!; #X text 77 64 cons: the regression test suite will block until the @@ -111,10 +123,19 @@ for testing signal-objects or timed objects); #X connect 14 0 2 0; #X connect 14 1 5 0; #X connect 15 0 10 0; -#X restore 94 138 pd run-test; -#X obj 94 163 outlet; -#X obj 94 111 inlet; +#X restore 94 218 pd run-test; +#X obj 94 243 outlet; +#X obj 94 191 inlet; #N canvas 487 407 450 300 \$0-regressiontest 0; -#X restore 92 186 pd \$0-regressiontest; +#X restore 92 266 pd \$0-regressiontest; +#X text 64 17 the test MUST IMMEDIATELY return a result!; +#X text 87 39 1: OK (test passed); +#X text 87 52 0: KO (test failed); +#X text 81 68 -1:; +#X text 103 68 WAIT (test takes some time); +#X text 64 92 if no result is returned immediately \, the test is considered +to be FAILED!; +#X text 63 131 note: we could have this be using "0" as the WAIT result +\, an no-result as KO \; for legacy reasons we don't; #X connect 0 0 1 0; #X connect 2 0 0 0; -- cgit v1.2.1