equal
deleted
inserted
replaced
9 category:'Builder-Reports' |
9 category:'Builder-Reports' |
10 ! |
10 ! |
11 |
11 |
12 TestResult subclass:#Result |
12 TestResult subclass:#Result |
13 instanceVariableNames:'format time npassed nfailed nerror nskipped collector' |
13 instanceVariableNames:'format time npassed nfailed nerror nskipped collector' |
14 classVariableNames:'' |
14 classVariableNames:'TimeoutScale' |
15 poolDictionaries:'' |
15 poolDictionaries:'' |
16 privateIn:TestReport |
16 privateIn:TestReport |
17 ! |
17 ! |
18 |
18 |
19 |
19 |
378 !TestReport::Result methodsFor:'initialization'! |
378 !TestReport::Result methodsFor:'initialization'! |
379 |
379 |
380 initialize |
380 initialize |
381 super initialize. |
381 super initialize. |
382 |
382 |
383 npassed := nfailed := nerror := nskipped := 0 |
383 npassed := nfailed := nerror := nskipped := 0. |
|
384 TimeoutScale isNil ifTrue:[ |
|
385 | bench | |
|
386 |
|
387 bench := Time millisecondsToRun:[3000 timesRepeat: [ 2000 factorial ]]. |
|
388 TimeoutScale := (bench / 2500"mean value of an i5 32bit") max: 1. |
|
389 ]. |
384 |
390 |
385 "Created: / 31-01-2013 / 13:52:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
391 "Created: / 31-01-2013 / 13:52:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
392 "Modified: / 14-11-2016 / 23:37:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
386 ! ! |
393 ! ! |
387 |
394 |
388 !TestReport::Result methodsFor:'running'! |
395 !TestReport::Result methodsFor:'running'! |
389 |
396 |
390 performCase:aTestCase |
397 performCase:aTestCase |
479 "Modified: / 29-10-2014 / 13:57:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
486 "Modified: / 29-10-2014 / 13:57:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
480 ! ! |
487 ! ! |
481 |
488 |
482 !TestReport::Result methodsFor:'running-private'! |
489 !TestReport::Result methodsFor:'running-private'! |
483 |
490 |
484 lightForkCase:aTestCase debugged: debugged timeout: timeout |
491 lightForkCase:aTestCase debugged: debugged timeout: timeoutBase |
485 | thread sema stime etime timeouted error stack log logPos | |
492 | timeout thread sema stime etime timeouted error stack log logPos | |
486 |
493 |
487 Logger trace: 'Running %1>>%2' with: aTestCase nameForHDTestReport with: aTestCase selectorForHDTestReport. |
494 Logger trace: 'Running %1>>%2' with: aTestCase nameForHDTestReport with: aTestCase selectorForHDTestReport. |
488 Transcript show:'F'. |
495 Transcript show:'F'. |
|
496 timeout := (timeoutBase * TimeoutScale) rounded. |
489 sema := Semaphore new. |
497 sema := Semaphore new. |
490 stime := OperatingSystem getMillisecondTime. |
498 stime := OperatingSystem getMillisecondTime. |
491 log := false. |
499 log := false. |
492 logPos := format stream stream position. |
500 logPos := format stream stream position. |
493 timeouted := false. |
501 timeouted := false. |
505 Transcript show: 'K'. |
513 Transcript show: 'K'. |
506 ]. |
514 ]. |
507 |
515 |
508 etime := OperatingSystem getMillisecondTime. |
516 etime := OperatingSystem getMillisecondTime. |
509 timeouted ifTrue:[ |
517 timeouted ifTrue:[ |
510 error := TimeoutError new messageText: 'Timed out'. |
518 error := TimeoutError new messageText: ('Timed out (effective %1ms, base %2ms, scale %3)' bindWith: timeout with: timeoutBase with:TimeoutScale) . |
511 outcome result: TestResult stateError. |
519 outcome result: TestResult stateError. |
512 format |
520 format |
513 writeTestCase: aTestCase outcome: outcome |
521 writeTestCase: aTestCase outcome: outcome |
514 time: etime - stime |
522 time: etime - stime |
515 exception: error |
523 exception: error |
520 |
528 |
521 outcome := nil. |
529 outcome := nil. |
522 Transcript cr. |
530 Transcript cr. |
523 |
531 |
524 "Created: / 12-01-2012 / 17:42:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
532 "Created: / 12-01-2012 / 17:42:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
525 "Modified: / 29-10-2014 / 13:59:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
533 "Modified: / 16-11-2016 / 23:26:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
526 ! |
534 ! |
527 |
535 |
528 unixForkCase:aTestCase debugged: debugged timeout: timeout |
536 unixForkCase:aTestCase debugged: debugged timeout: timeoutBase |
529 | pid status sema stime etime error stack suiteFailuresBefore suiteErrorsBefore log logPos | |
537 | timeout pid status sema stime etime error stack suiteFailuresBefore suiteErrorsBefore log logPos | |
530 |
538 |
531 Transcript show:'forking...'. |
539 Transcript show:'forking...'. |
|
540 timeout := (timeoutBase * TimeoutScale) rounded. |
532 sema := Semaphore new. |
541 sema := Semaphore new. |
533 stime := OperatingSystem getMillisecondTime. |
542 stime := OperatingSystem getMillisecondTime. |
534 log := false. |
543 log := false. |
535 logPos := format stream stream position. |
544 logPos := format stream stream position. |
536 Processor monitor: |
545 Processor monitor: |
576 super addPass: aTestCase. |
585 super addPass: aTestCase. |
577 ] ifTrue: |
586 ] ifTrue: |
578 [ log := true. |
587 [ log := true. |
579 status isNil |
588 status isNil |
580 ifTrue: |
589 ifTrue: |
581 [ error := TimeoutError new parameter:timeout. |
590 [ error := TimeoutError new messageText: ('Timed out (effective %1ms, base %2ms, scale %3)' bindWith: timeout with: timeoutBase with:TimeoutScale) . |
582 stack := 'Oops, timed out!! (timeout was ' , timeout printString , ' sec)'. ] |
591 stack := 'Oops, timed out!! (timeout was ' , timeout printString , ' sec)'. ] |
583 ifFalse: |
592 ifFalse: |
584 [ status status == #signal |
593 [ status status == #signal |
585 ifTrue: |
594 ifTrue: |
586 [ error := OSSignalInterrupt new parameter:status code. |
595 [ error := OSSignalInterrupt new parameter:status code. |
613 ]. |
622 ]. |
614 outcome := nil. |
623 outcome := nil. |
615 Transcript cr. |
624 Transcript cr. |
616 |
625 |
617 "Created: / 12-01-2012 / 17:43:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
626 "Created: / 12-01-2012 / 17:43:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
618 "Modified: / 06-06-2014 / 00:54:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
627 "Modified: / 16-11-2016 / 23:26:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
619 ! ! |
628 ! ! |
620 |
629 |
621 !TestReport class methodsFor:'documentation'! |
630 !TestReport class methodsFor:'documentation'! |
622 |
631 |
623 version |
632 version |