From c71afaf1f8fa3f333dc75b21ee413a1c90211d3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 21 Jun 2006 11:03:57 +0000 Subject: tests now MUST return a value in order to stop (destroy) the specific test; this allows for tests that execute in non-zero logical time (e.g. signal-objects or timed objects) svn path=/trunk/externals/zexy/; revision=5279 --- tests/runtests.pd | 21 ++++---- tests/runtests_nogui.pd | 89 ++++++++++++++++---------------- tests/testunit.pd | 131 +++++++++++++++++++++++++++++++----------------- 3 files changed, 142 insertions(+), 99 deletions(-) (limited to 'tests') diff --git a/tests/runtests.pd b/tests/runtests.pd index db72b4c..5e7abc2 100644 --- a/tests/runtests.pd +++ b/tests/runtests.pd @@ -1,22 +1,21 @@ -#N canvas 367 200 813 499 10; +#N canvas 211 200 452 500 10; #X obj 177 433 testunit; #X obj 177 377 textfile; #X obj 177 183 t b b; #X msg 207 261 read runtests.txt \, rewind; -#X obj 177 287 metro 10; -#X msg 243 289 0; #X obj 177 126 bng 40 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 177 351 bang; #X symbolatom 195 408 10 0 0 0 - - -; -#X obj 485 341 mtx_col/exist; +#X obj 102 314 t b; +#X obj 102 342 del 10; +#X connect 0 0 7 0; #X connect 1 0 0 0; -#X connect 1 1 5 0; -#X connect 2 0 4 0; +#X connect 2 0 5 0; #X connect 2 1 3 0; #X connect 3 0 1 0; -#X connect 4 0 7 0; -#X connect 5 0 4 0; -#X connect 6 0 2 0; -#X connect 7 0 1 0; -#X connect 8 0 0 0; +#X connect 4 0 2 0; +#X connect 5 0 1 0; +#X connect 6 0 0 0; +#X connect 7 0 8 0; +#X connect 8 0 1 0; diff --git a/tests/runtests_nogui.pd b/tests/runtests_nogui.pd index 229874d..497368d 100644 --- a/tests/runtests_nogui.pd +++ b/tests/runtests_nogui.pd @@ -1,44 +1,49 @@ -#N canvas 209 168 427 557 10; -#X obj 86 209 testunit; -#X obj 86 130 textfile; -#X obj 86 56 t b b; -#X msg 116 84 read runtests.txt \, rewind; +#N canvas 338 0 512 588 10; +#X obj 86 269 testunit; +#X obj 86 190 textfile; +#X msg 104 144 read runtests.txt \, rewind; #X obj 86 34 loadbang; -#X msg 137 171 \; pd quit; -#X obj 86 110 until; -#X obj 86 233 select 0 1; -#X obj 111 259 + 1; -#X obj 171 259 + 1; -#X obj 87 312 i; -#X obj 130 312 i; -#X obj 130 381 print regression-test; -#X msg 130 356 \$1 tests passed; -#X msg 87 335 \$1 tests failed; -#X obj 87 291 t b b; -#X obj 137 150 t b b; -#X obj 86 259 i 1; -#X obj 146 259 i 1; -#X connect 0 0 7 0; +#X msg 137 231 \; pd quit; +#X obj 86 317 select 0 1; +#X obj 111 343 + 1; +#X obj 171 343 + 1; +#X obj 87 396 i; +#X obj 130 396 i; +#X obj 130 465 print regression-test; +#X msg 130 440 \$1 tests passed; +#X msg 87 419 \$1 tests failed; +#X obj 87 375 t b b; +#X obj 137 210 t b b; +#X obj 86 343 i 1; +#X obj 146 343 i 1; +#X obj 86 56 t b b b; +#X msg 123 98 \; pd dsp 1; +#X text 182 106 turn on dsp \, just in case an object crashes with +dsp enabled...; +#X obj 61 295 t b a; +#X connect 0 0 20 0; #X connect 1 0 0 0; -#X connect 1 1 16 0; -#X connect 2 0 6 0; -#X connect 2 1 3 0; -#X connect 3 0 1 0; -#X connect 4 0 2 0; -#X connect 6 0 1 0; -#X connect 7 0 17 0; -#X connect 7 1 18 0; -#X connect 8 0 17 1; -#X connect 9 0 18 1; -#X connect 10 0 14 0; -#X connect 11 0 13 0; -#X connect 13 0 12 0; -#X connect 14 0 12 0; -#X connect 15 0 10 0; -#X connect 15 1 11 0; -#X connect 16 0 5 0; -#X connect 16 1 15 0; -#X connect 17 0 8 0; -#X connect 17 0 10 1; -#X connect 18 0 9 0; -#X connect 18 0 11 1; +#X connect 1 1 14 0; +#X connect 2 0 1 0; +#X connect 3 0 17 0; +#X connect 5 0 15 0; +#X connect 5 1 16 0; +#X connect 6 0 15 1; +#X connect 7 0 16 1; +#X connect 8 0 12 0; +#X connect 9 0 11 0; +#X connect 11 0 10 0; +#X connect 12 0 10 0; +#X connect 13 0 8 0; +#X connect 13 1 9 0; +#X connect 14 0 4 0; +#X connect 14 1 13 0; +#X connect 15 0 6 0; +#X connect 15 0 8 1; +#X connect 16 0 7 0; +#X connect 16 0 9 1; +#X connect 17 0 1 0; +#X connect 17 1 2 0; +#X connect 17 2 18 0; +#X connect 20 0 1 0; +#X connect 20 1 5 0; diff --git a/tests/testunit.pd b/tests/testunit.pd index b5823fa..1662d43 100644 --- a/tests/testunit.pd +++ b/tests/testunit.pd @@ -1,21 +1,17 @@ -#N canvas 695 274 312 252 10; -#N canvas 0 0 564 876 run-test 0; -#X obj 87 512 r \$0-receive; -#X obj 71 532 f; -#X msg 96 533 0; +#N canvas 302 200 312 252 10; +#N canvas 47 151 894 418 run-test 0; #X obj 71 76 symbol; #X obj 71 44 inlet test-to-run; -#X obj 71 639 outlet result; -#X obj 71 615 pack 0 s; -#X obj 181 205 makefilename pd-%d-regressiontest; -#X obj 109 226 pack s \$0 s; -#X obj 181 186 f \$0; -#X obj 109 160 t s b; -#X obj 143 489 t b s s; -#X obj 71 104 t b b s s; -#X msg 140 72 bang; -#X obj 90 135 s \$0-send; -#X msg 109 246 \; \$3 clear \; \$3 obj 100 100 r \$2-send \; \$3 obj +#X obj 506 344 outlet result; +#X obj 506 320 pack 0 s; +#X obj 150 155 makefilename pd-%d-regressiontest; +#X obj 89 195 pack s \$0 s; +#X obj 150 136 f \$0; +#X obj 89 130 t s b; +#X obj 506 140 t b s s; +#X msg 113 76 bang; +#X obj 71 314 s \$0-send; +#X msg 89 215 \; \$3 clear \; \$3 obj 100 100 r \$2-send \; \$3 obj 100 150 \$1 \; \$3 obj 100 200 s \$2-receive \; \$3 connect 0 0 1 0 \; \$3 connect 1 0 2 0; #N canvas 395 348 450 300 print 0; @@ -39,40 +35,83 @@ #X connect 7 0 0 0; #X connect 8 0 1 1; #X connect 9 0 2 0; -#X restore 101 584 pd print result; -#X obj 71 565 t f f; -#X msg 101 406 \; \$1 clear; -#X obj 101 386 symbol; -#X obj 71 364 t b b; -#X connect 0 0 1 1; -#X connect 1 0 17 0; -#X connect 2 0 1 1; -#X connect 3 0 12 0; -#X connect 4 0 3 0; -#X connect 6 0 5 0; -#X connect 7 0 8 2; -#X connect 7 0 19 1; -#X connect 8 0 15 0; -#X connect 9 0 7 0; -#X connect 10 0 8 0; -#X connect 10 1 9 0; -#X connect 11 0 2 0; -#X connect 11 1 6 1; -#X connect 11 2 16 1; -#X connect 12 0 20 0; -#X connect 12 1 14 0; -#X connect 12 2 10 0; -#X connect 12 3 11 0; +#X restore 531 291 pd print result; +#X obj 506 270 t f f; +#X msg 531 235 \; \$1 clear; +#X obj 531 215 symbol; +#X obj 506 182 t f b; +#X obj 71 104 t b s s; +#X text 63 387 start regression test; +#X text 501 391 regression test finished; +#N canvas 0 0 450 475 get 0; +#X obj 106 36 r \$0-receive; +#X msg 137 280 0; +#X obj 106 159 del 0; +#X obj 106 310 f; +#X text 193 34 get the result; +#X text 145 155 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 137 236 inlet reset; +#X obj 106 336 t b f; +#X obj 106 95 spigot; +#X obj 137 258 t b b; +#X msg 161 74 1; +#X obj 106 117 t b f b; +#X msg 189 74 0; +#X obj 137 74 t f; +#X text 182 98 we only accept the 1st result of the test; +#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 10 0; +#X connect 8 0 11 0; +#X connect 8 1 6 0; +#X connect 9 0 12 0; +#X connect 10 0 1 0; +#X connect 10 1 11 0; +#X connect 11 0 14 0; +#X connect 12 0 2 0; +#X connect 12 1 3 1; +#X connect 12 2 13 0; +#X connect 13 0 14 0; +#X connect 14 0 9 1; +#X restore 506 162 pd get result; +#X obj 150 175 t s s; +#X text 401 23 the test MUST return a result!; +#X text 414 70 cons: the regression test suite will block until the +test returns a result (potentially infinitely long)!; +#X text 414 39 pros: the test need not be finished in zero-time (good +for testing signal-objects or timed objects); +#X connect 0 0 17 0; +#X connect 1 0 0 0; +#X connect 3 0 2 0; +#X connect 4 0 21 0; +#X connect 5 0 11 0; +#X connect 6 0 4 0; +#X connect 7 0 5 0; +#X connect 7 1 6 0; +#X connect 8 0 20 0; +#X connect 8 1 3 1; +#X connect 8 2 12 1; +#X connect 9 0 0 0; #X connect 13 0 3 0; -#X connect 17 0 6 0; -#X connect 17 1 16 0; -#X connect 19 0 18 0; -#X connect 20 0 1 0; -#X connect 20 1 19 0; +#X connect 13 1 12 0; +#X connect 15 0 14 0; +#X connect 16 0 13 0; +#X connect 16 1 15 0; +#X connect 17 0 10 0; +#X connect 17 1 7 0; +#X connect 17 2 8 0; +#X connect 20 0 16 0; +#X connect 21 0 5 2; +#X connect 21 1 15 1; #X restore 94 138 pd run-test; #X obj 94 163 outlet; #X obj 94 111 inlet; -#N canvas 487 407 450 300 1005-regressiontest 0; +#N canvas 487 407 450 300 1002-regressiontest 0; #X restore 92 186 pd \$0-regressiontest; #X connect 0 0 1 0; #X connect 2 0 0 0; -- cgit v1.2.1