resin 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/amber/bin/amberc +4 -3
- data/amber/js/IDE.deploy.js +147 -45
- data/amber/js/IDE.js +155 -53
- data/amber/js/Kernel-Classes.deploy.js +20 -14
- data/amber/js/Kernel-Classes.js +29 -18
- data/amber/js/Kernel-Collections.deploy.js +82 -0
- data/amber/js/Kernel-Collections.js +102 -0
- data/amber/js/Kernel-Methods.deploy.js +374 -261
- data/amber/js/Kernel-Methods.js +417 -269
- data/amber/js/Kernel-Objects.deploy.js +90 -28
- data/amber/js/Kernel-Objects.js +121 -34
- data/amber/js/Kernel-Tests.deploy.js +35 -0
- data/amber/js/Kernel-Tests.js +45 -0
- data/amber/js/SUnit.deploy.js +175 -17
- data/amber/js/SUnit.js +237 -24
- data/amber/js/amber.js +2 -1
- data/amber/js/boot.js +74 -18
- data/amber/js/lib/es5-shim-2.0.2/CHANGES +93 -0
- data/amber/js/lib/es5-shim-2.0.2/CONTRIBUTORS.md +25 -0
- data/amber/js/lib/es5-shim-2.0.2/LICENSE +19 -0
- data/amber/js/lib/es5-shim-2.0.2/README.md +161 -0
- data/amber/js/lib/es5-shim-2.0.2/es5-sham.js +348 -0
- data/amber/js/lib/es5-shim-2.0.2/es5-sham.min.js +6 -0
- data/amber/js/lib/es5-shim-2.0.2/es5-shim.js +963 -0
- data/amber/js/lib/es5-shim-2.0.2/es5-shim.min.js +16 -0
- data/amber/js/lib/es5-shim-2.0.2/minify +2 -0
- data/amber/js/lib/es5-shim-2.0.2/package.json +31 -0
- data/amber/js/lib/es5-shim-2.0.2/tests/helpers/h-kill.js +59 -0
- data/amber/js/lib/es5-shim-2.0.2/tests/helpers/h-matchers.js +34 -0
- data/amber/js/lib/es5-shim-2.0.2/tests/helpers/h.js +3 -0
- data/amber/js/lib/es5-shim-2.0.2/tests/index.html +62 -0
- data/amber/js/lib/es5-shim-2.0.2/tests/lib/jasmine-html.js +190 -0
- data/amber/js/lib/es5-shim-2.0.2/tests/lib/jasmine.css +166 -0
- data/amber/js/lib/es5-shim-2.0.2/tests/lib/jasmine.js +2477 -0
- data/amber/js/lib/es5-shim-2.0.2/tests/lib/jasmine_favicon.png +0 -0
- data/amber/js/lib/es5-shim-2.0.2/tests/lib/json2.js +478 -0
- data/amber/js/lib/es5-shim-2.0.2/tests/spec/s-array.js +1138 -0
- data/amber/js/lib/es5-shim-2.0.2/tests/spec/s-date.js +117 -0
- data/amber/js/lib/es5-shim-2.0.2/tests/spec/s-function.js +147 -0
- data/amber/js/lib/es5-shim-2.0.2/tests/spec/s-object.js +84 -0
- data/amber/js/lib/es5-shim-2.0.2/tests/spec/s-string.js +24 -0
- data/amber/st/IDE.st +15 -16
- data/amber/st/Kernel-Classes.st +9 -9
- data/amber/st/Kernel-Collections.st +37 -0
- data/amber/st/Kernel-Methods.st +63 -8
- data/amber/st/Kernel-Objects.st +34 -7
- data/amber/st/Kernel-Tests.st +10 -0
- data/amber/st/SUnit.st +86 -9
- metadata +44 -21
- data/amber/js/compat.js +0 -22
data/amber/js/SUnit.deploy.js
CHANGED
|
@@ -1,4 +1,29 @@
|
|
|
1
1
|
smalltalk.addPackage('SUnit', {});
|
|
2
|
+
smalltalk.addClass('ResultAnnouncement', smalltalk.Object, ['result'], 'SUnit');
|
|
3
|
+
smalltalk.addMethod(
|
|
4
|
+
"_result",
|
|
5
|
+
smalltalk.method({
|
|
6
|
+
selector: "result",
|
|
7
|
+
fn: function (){
|
|
8
|
+
var self=this;
|
|
9
|
+
return self["@result"];
|
|
10
|
+
}
|
|
11
|
+
}),
|
|
12
|
+
smalltalk.ResultAnnouncement);
|
|
13
|
+
|
|
14
|
+
smalltalk.addMethod(
|
|
15
|
+
"_result_",
|
|
16
|
+
smalltalk.method({
|
|
17
|
+
selector: "result:",
|
|
18
|
+
fn: function (aTestResult){
|
|
19
|
+
var self=this;
|
|
20
|
+
self["@result"]=aTestResult;
|
|
21
|
+
return self}
|
|
22
|
+
}),
|
|
23
|
+
smalltalk.ResultAnnouncement);
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
2
27
|
smalltalk.addClass('TestCase', smalltalk.Object, ['testSelector'], 'SUnit');
|
|
3
28
|
smalltalk.addMethod(
|
|
4
29
|
"_assert_",
|
|
@@ -52,29 +77,29 @@ fn: function (aBoolean) {
|
|
|
52
77
|
smalltalk.TestCase);
|
|
53
78
|
|
|
54
79
|
smalltalk.addMethod(
|
|
55
|
-
"
|
|
80
|
+
"_performTest",
|
|
56
81
|
smalltalk.method({
|
|
57
|
-
selector: "
|
|
58
|
-
fn: function (
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
82
|
+
selector: "performTest",
|
|
83
|
+
fn: function (){
|
|
84
|
+
var self=this;
|
|
85
|
+
smalltalk.send(self,"_perform_",[smalltalk.send(self,"_selector",[])]);
|
|
86
|
+
return self}
|
|
63
87
|
}),
|
|
64
88
|
smalltalk.TestCase);
|
|
65
89
|
|
|
66
90
|
smalltalk.addMethod(
|
|
67
|
-
"
|
|
91
|
+
"_runCase",
|
|
68
92
|
smalltalk.method({
|
|
69
|
-
selector: "
|
|
70
|
-
fn: function (
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
93
|
+
selector: "runCase",
|
|
94
|
+
fn: function (){
|
|
95
|
+
var self=this;
|
|
96
|
+
smalltalk.send((function(){
|
|
97
|
+
smalltalk.send(self,"_setUp",[]);
|
|
98
|
+
return smalltalk.send(self,"_performTest",[]);
|
|
99
|
+
}),"_ensure_",[(function(){
|
|
100
|
+
return smalltalk.send(self,"_tearDown",[]);
|
|
101
|
+
})]);
|
|
102
|
+
return self}
|
|
78
103
|
}),
|
|
79
104
|
smalltalk.TestCase);
|
|
80
105
|
|
|
@@ -352,6 +377,42 @@ fn: function () {
|
|
|
352
377
|
}),
|
|
353
378
|
smalltalk.TestResult);
|
|
354
379
|
|
|
380
|
+
smalltalk.addMethod(
|
|
381
|
+
"_nextRunDo_",
|
|
382
|
+
smalltalk.method({
|
|
383
|
+
selector: "nextRunDo:",
|
|
384
|
+
fn: function (aBlock){
|
|
385
|
+
var self=this;
|
|
386
|
+
var $2,$1;
|
|
387
|
+
$2=smalltalk.send(smalltalk.send(self,"_runs",[]),"__eq_eq",[smalltalk.send(self,"_total",[])]);
|
|
388
|
+
if(! smalltalk.assert($2)){
|
|
389
|
+
$1=smalltalk.send(aBlock,"_value_",[smalltalk.send(smalltalk.send(self,"_runs",[]),"__plus",[(1)])]);
|
|
390
|
+
};
|
|
391
|
+
return $1;
|
|
392
|
+
}
|
|
393
|
+
}),
|
|
394
|
+
smalltalk.TestResult);
|
|
395
|
+
|
|
396
|
+
smalltalk.addMethod(
|
|
397
|
+
"_runCase_",
|
|
398
|
+
smalltalk.method({
|
|
399
|
+
selector: "runCase:",
|
|
400
|
+
fn: function (aTestCase){
|
|
401
|
+
var self=this;
|
|
402
|
+
smalltalk.send((function(){
|
|
403
|
+
return smalltalk.send((function(){
|
|
404
|
+
smalltalk.send(self,"_increaseRuns",[]);
|
|
405
|
+
return smalltalk.send(aTestCase,"_runCase",[]);
|
|
406
|
+
}),"_on_do_",[(smalltalk.TestFailure || TestFailure),(function(ex){
|
|
407
|
+
return smalltalk.send(self,"_addFailure_",[aTestCase]);
|
|
408
|
+
})]);
|
|
409
|
+
}),"_on_do_",[(smalltalk.Error || Error),(function(ex){
|
|
410
|
+
return smalltalk.send(self,"_addError_",[aTestCase]);
|
|
411
|
+
})]);
|
|
412
|
+
return self}
|
|
413
|
+
}),
|
|
414
|
+
smalltalk.TestResult);
|
|
415
|
+
|
|
355
416
|
smalltalk.addMethod(
|
|
356
417
|
"_runs",
|
|
357
418
|
smalltalk.method({
|
|
@@ -422,3 +483,100 @@ smalltalk.TestResult);
|
|
|
422
483
|
|
|
423
484
|
|
|
424
485
|
|
|
486
|
+
smalltalk.addClass('TestSuiteRunner', smalltalk.Object, ['suite', 'result', 'announcer'], 'SUnit');
|
|
487
|
+
smalltalk.addMethod(
|
|
488
|
+
"_announcer",
|
|
489
|
+
smalltalk.method({
|
|
490
|
+
selector: "announcer",
|
|
491
|
+
fn: function (){
|
|
492
|
+
var self=this;
|
|
493
|
+
return self["@announcer"];
|
|
494
|
+
}
|
|
495
|
+
}),
|
|
496
|
+
smalltalk.TestSuiteRunner);
|
|
497
|
+
|
|
498
|
+
smalltalk.addMethod(
|
|
499
|
+
"_initialize",
|
|
500
|
+
smalltalk.method({
|
|
501
|
+
selector: "initialize",
|
|
502
|
+
fn: function (){
|
|
503
|
+
var self=this;
|
|
504
|
+
smalltalk.send(self,"_initialize",[],smalltalk.Object);
|
|
505
|
+
self["@announcer"]=smalltalk.send((smalltalk.Announcer || Announcer),"_new",[]);
|
|
506
|
+
self["@result"]=smalltalk.send((smalltalk.TestResult || TestResult),"_new",[]);
|
|
507
|
+
return self}
|
|
508
|
+
}),
|
|
509
|
+
smalltalk.TestSuiteRunner);
|
|
510
|
+
|
|
511
|
+
smalltalk.addMethod(
|
|
512
|
+
"_result",
|
|
513
|
+
smalltalk.method({
|
|
514
|
+
selector: "result",
|
|
515
|
+
fn: function (){
|
|
516
|
+
var self=this;
|
|
517
|
+
return self["@result"];
|
|
518
|
+
}
|
|
519
|
+
}),
|
|
520
|
+
smalltalk.TestSuiteRunner);
|
|
521
|
+
|
|
522
|
+
smalltalk.addMethod(
|
|
523
|
+
"_run",
|
|
524
|
+
smalltalk.method({
|
|
525
|
+
selector: "run",
|
|
526
|
+
fn: function (){
|
|
527
|
+
var self=this;
|
|
528
|
+
var worker;
|
|
529
|
+
smalltalk.send(self["@result"],"_total_",[smalltalk.send(self["@suite"],"_size",[])]);
|
|
530
|
+
smalltalk.send(self["@announcer"],"_announce_",[smalltalk.send(smalltalk.send((smalltalk.ResultAnnouncement || ResultAnnouncement),"_new",[]),"_result_",[self["@result"]])]);
|
|
531
|
+
worker=(function(){
|
|
532
|
+
return smalltalk.send(self["@result"],"_nextRunDo_",[(function(index){
|
|
533
|
+
return smalltalk.send((function(){
|
|
534
|
+
return smalltalk.send(self["@result"],"_runCase_",[smalltalk.send(self["@suite"],"_at_",[index])]);
|
|
535
|
+
}),"_ensure_",[(function(){
|
|
536
|
+
smalltalk.send(worker,"_fork",[]);
|
|
537
|
+
return smalltalk.send(self["@announcer"],"_announce_",[smalltalk.send(smalltalk.send((smalltalk.ResultAnnouncement || ResultAnnouncement),"_new",[]),"_result_",[self["@result"]])]);
|
|
538
|
+
})]);
|
|
539
|
+
})]);
|
|
540
|
+
});
|
|
541
|
+
smalltalk.send(worker,"_fork",[]);
|
|
542
|
+
return self}
|
|
543
|
+
}),
|
|
544
|
+
smalltalk.TestSuiteRunner);
|
|
545
|
+
|
|
546
|
+
smalltalk.addMethod(
|
|
547
|
+
"_suite_",
|
|
548
|
+
smalltalk.method({
|
|
549
|
+
selector: "suite:",
|
|
550
|
+
fn: function (aCollection){
|
|
551
|
+
var self=this;
|
|
552
|
+
self["@suite"]=aCollection;
|
|
553
|
+
return self}
|
|
554
|
+
}),
|
|
555
|
+
smalltalk.TestSuiteRunner);
|
|
556
|
+
|
|
557
|
+
|
|
558
|
+
smalltalk.addMethod(
|
|
559
|
+
"_new",
|
|
560
|
+
smalltalk.method({
|
|
561
|
+
selector: "new",
|
|
562
|
+
fn: function (){
|
|
563
|
+
var self=this;
|
|
564
|
+
smalltalk.send(self,"_shouldNotImplement",[]);
|
|
565
|
+
return self}
|
|
566
|
+
}),
|
|
567
|
+
smalltalk.TestSuiteRunner.klass);
|
|
568
|
+
|
|
569
|
+
smalltalk.addMethod(
|
|
570
|
+
"_on_",
|
|
571
|
+
smalltalk.method({
|
|
572
|
+
selector: "on:",
|
|
573
|
+
fn: function (aCollection){
|
|
574
|
+
var self=this;
|
|
575
|
+
var $1;
|
|
576
|
+
$1=smalltalk.send(smalltalk.send(self,"_new",[],smalltalk.Object.klass),"_suite_",[aCollection]);
|
|
577
|
+
return $1;
|
|
578
|
+
}
|
|
579
|
+
}),
|
|
580
|
+
smalltalk.TestSuiteRunner.klass);
|
|
581
|
+
|
|
582
|
+
|
data/amber/js/SUnit.js
CHANGED
|
@@ -1,4 +1,39 @@
|
|
|
1
1
|
smalltalk.addPackage('SUnit', {});
|
|
2
|
+
smalltalk.addClass('ResultAnnouncement', smalltalk.Object, ['result'], 'SUnit');
|
|
3
|
+
smalltalk.addMethod(
|
|
4
|
+
"_result",
|
|
5
|
+
smalltalk.method({
|
|
6
|
+
selector: "result",
|
|
7
|
+
category: 'accessing',
|
|
8
|
+
fn: function (){
|
|
9
|
+
var self=this;
|
|
10
|
+
return self["@result"];
|
|
11
|
+
},
|
|
12
|
+
args: [],
|
|
13
|
+
source: "result\x0a\x09^result",
|
|
14
|
+
messageSends: [],
|
|
15
|
+
referencedClasses: []
|
|
16
|
+
}),
|
|
17
|
+
smalltalk.ResultAnnouncement);
|
|
18
|
+
|
|
19
|
+
smalltalk.addMethod(
|
|
20
|
+
"_result_",
|
|
21
|
+
smalltalk.method({
|
|
22
|
+
selector: "result:",
|
|
23
|
+
category: 'accessing',
|
|
24
|
+
fn: function (aTestResult){
|
|
25
|
+
var self=this;
|
|
26
|
+
self["@result"]=aTestResult;
|
|
27
|
+
return self},
|
|
28
|
+
args: ["aTestResult"],
|
|
29
|
+
source: "result: aTestResult\x0a\x09result := aTestResult",
|
|
30
|
+
messageSends: [],
|
|
31
|
+
referencedClasses: []
|
|
32
|
+
}),
|
|
33
|
+
smalltalk.ResultAnnouncement);
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
2
37
|
smalltalk.addClass('TestCase', smalltalk.Object, ['testSelector'], 'SUnit');
|
|
3
38
|
smalltalk.addMethod(
|
|
4
39
|
"_assert_",
|
|
@@ -72,38 +107,38 @@ referencedClasses: []
|
|
|
72
107
|
smalltalk.TestCase);
|
|
73
108
|
|
|
74
109
|
smalltalk.addMethod(
|
|
75
|
-
"
|
|
110
|
+
"_performTest",
|
|
76
111
|
smalltalk.method({
|
|
77
|
-
selector: "
|
|
112
|
+
selector: "performTest",
|
|
78
113
|
category: 'running',
|
|
79
|
-
fn: function (
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
referencedClasses: ["Error", "TestFailure"]
|
|
114
|
+
fn: function (){
|
|
115
|
+
var self=this;
|
|
116
|
+
smalltalk.send(self,"_perform_",[smalltalk.send(self,"_selector",[])]);
|
|
117
|
+
return self},
|
|
118
|
+
args: [],
|
|
119
|
+
source: "performTest\x0a\x09self perform: self selector\x0a",
|
|
120
|
+
messageSends: ["perform:", "selector"],
|
|
121
|
+
referencedClasses: []
|
|
88
122
|
}),
|
|
89
123
|
smalltalk.TestCase);
|
|
90
124
|
|
|
91
125
|
smalltalk.addMethod(
|
|
92
|
-
"
|
|
126
|
+
"_runCase",
|
|
93
127
|
smalltalk.method({
|
|
94
|
-
selector: "
|
|
128
|
+
selector: "runCase",
|
|
95
129
|
category: 'running',
|
|
96
|
-
fn: function (
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
130
|
+
fn: function (){
|
|
131
|
+
var self=this;
|
|
132
|
+
smalltalk.send((function(){
|
|
133
|
+
smalltalk.send(self,"_setUp",[]);
|
|
134
|
+
return smalltalk.send(self,"_performTest",[]);
|
|
135
|
+
}),"_ensure_",[(function(){
|
|
136
|
+
return smalltalk.send(self,"_tearDown",[]);
|
|
137
|
+
})]);
|
|
138
|
+
return self},
|
|
139
|
+
args: [],
|
|
140
|
+
source: "runCase\x0a\x09[\x09self setUp.\x0a\x09\x09self performTest ] ensure: [\x0a\x09\x09self tearDown.\x0a\x09\x09\x22self cleanUpInstanceVariables\x22 ]\x0a",
|
|
141
|
+
messageSends: ["ensure:", "tearDown", "setUp", "performTest"],
|
|
107
142
|
referencedClasses: []
|
|
108
143
|
}),
|
|
109
144
|
smalltalk.TestCase);
|
|
@@ -487,6 +522,52 @@ referencedClasses: ["Date", "Array"]
|
|
|
487
522
|
}),
|
|
488
523
|
smalltalk.TestResult);
|
|
489
524
|
|
|
525
|
+
smalltalk.addMethod(
|
|
526
|
+
"_nextRunDo_",
|
|
527
|
+
smalltalk.method({
|
|
528
|
+
selector: "nextRunDo:",
|
|
529
|
+
category: 'running',
|
|
530
|
+
fn: function (aBlock){
|
|
531
|
+
var self=this;
|
|
532
|
+
var $2,$1;
|
|
533
|
+
$2=smalltalk.send(smalltalk.send(self,"_runs",[]),"__eq_eq",[smalltalk.send(self,"_total",[])]);
|
|
534
|
+
if(! smalltalk.assert($2)){
|
|
535
|
+
$1=smalltalk.send(aBlock,"_value_",[smalltalk.send(smalltalk.send(self,"_runs",[]),"__plus",[(1)])]);
|
|
536
|
+
};
|
|
537
|
+
return $1;
|
|
538
|
+
},
|
|
539
|
+
args: ["aBlock"],
|
|
540
|
+
source: "nextRunDo: aBlock\x0a\x22Runs aBlock with index of next run\x0aor does nothing if no more runs\x22\x0a^self runs == self total\x0a\x09ifFalse: [ aBlock value: self runs + 1 ]",
|
|
541
|
+
messageSends: ["ifFalse:", "value:", "+", "runs", "==", "total"],
|
|
542
|
+
referencedClasses: []
|
|
543
|
+
}),
|
|
544
|
+
smalltalk.TestResult);
|
|
545
|
+
|
|
546
|
+
smalltalk.addMethod(
|
|
547
|
+
"_runCase_",
|
|
548
|
+
smalltalk.method({
|
|
549
|
+
selector: "runCase:",
|
|
550
|
+
category: 'running',
|
|
551
|
+
fn: function (aTestCase){
|
|
552
|
+
var self=this;
|
|
553
|
+
smalltalk.send((function(){
|
|
554
|
+
return smalltalk.send((function(){
|
|
555
|
+
smalltalk.send(self,"_increaseRuns",[]);
|
|
556
|
+
return smalltalk.send(aTestCase,"_runCase",[]);
|
|
557
|
+
}),"_on_do_",[(smalltalk.TestFailure || TestFailure),(function(ex){
|
|
558
|
+
return smalltalk.send(self,"_addFailure_",[aTestCase]);
|
|
559
|
+
})]);
|
|
560
|
+
}),"_on_do_",[(smalltalk.Error || Error),(function(ex){
|
|
561
|
+
return smalltalk.send(self,"_addError_",[aTestCase]);
|
|
562
|
+
})]);
|
|
563
|
+
return self},
|
|
564
|
+
args: ["aTestCase"],
|
|
565
|
+
source: "runCase: aTestCase\x0a\x09[[\x09self increaseRuns.\x0a \x09aTestCase runCase]\x0a\x09on: TestFailure do: [:ex | self addFailure: aTestCase]]\x0a\x09on: Error do: [:ex | self addError: aTestCase]\x0a",
|
|
566
|
+
messageSends: ["on:do:", "addError:", "addFailure:", "increaseRuns", "runCase"],
|
|
567
|
+
referencedClasses: ["Error", "TestFailure"]
|
|
568
|
+
}),
|
|
569
|
+
smalltalk.TestResult);
|
|
570
|
+
|
|
490
571
|
smalltalk.addMethod(
|
|
491
572
|
"_runs",
|
|
492
573
|
smalltalk.method({
|
|
@@ -582,3 +663,135 @@ smalltalk.TestResult);
|
|
|
582
663
|
|
|
583
664
|
|
|
584
665
|
|
|
666
|
+
smalltalk.addClass('TestSuiteRunner', smalltalk.Object, ['suite', 'result', 'announcer'], 'SUnit');
|
|
667
|
+
smalltalk.addMethod(
|
|
668
|
+
"_announcer",
|
|
669
|
+
smalltalk.method({
|
|
670
|
+
selector: "announcer",
|
|
671
|
+
category: 'accessing',
|
|
672
|
+
fn: function (){
|
|
673
|
+
var self=this;
|
|
674
|
+
return self["@announcer"];
|
|
675
|
+
},
|
|
676
|
+
args: [],
|
|
677
|
+
source: "announcer\x0a\x09^announcer",
|
|
678
|
+
messageSends: [],
|
|
679
|
+
referencedClasses: []
|
|
680
|
+
}),
|
|
681
|
+
smalltalk.TestSuiteRunner);
|
|
682
|
+
|
|
683
|
+
smalltalk.addMethod(
|
|
684
|
+
"_initialize",
|
|
685
|
+
smalltalk.method({
|
|
686
|
+
selector: "initialize",
|
|
687
|
+
category: 'initialization',
|
|
688
|
+
fn: function (){
|
|
689
|
+
var self=this;
|
|
690
|
+
smalltalk.send(self,"_initialize",[],smalltalk.Object);
|
|
691
|
+
self["@announcer"]=smalltalk.send((smalltalk.Announcer || Announcer),"_new",[]);
|
|
692
|
+
self["@result"]=smalltalk.send((smalltalk.TestResult || TestResult),"_new",[]);
|
|
693
|
+
return self},
|
|
694
|
+
args: [],
|
|
695
|
+
source: "initialize\x0a\x09super initialize.\x0a\x09announcer := Announcer new.\x0a result := TestResult new",
|
|
696
|
+
messageSends: ["initialize", "new"],
|
|
697
|
+
referencedClasses: ["Announcer", "TestResult"]
|
|
698
|
+
}),
|
|
699
|
+
smalltalk.TestSuiteRunner);
|
|
700
|
+
|
|
701
|
+
smalltalk.addMethod(
|
|
702
|
+
"_result",
|
|
703
|
+
smalltalk.method({
|
|
704
|
+
selector: "result",
|
|
705
|
+
category: 'accessing',
|
|
706
|
+
fn: function (){
|
|
707
|
+
var self=this;
|
|
708
|
+
return self["@result"];
|
|
709
|
+
},
|
|
710
|
+
args: [],
|
|
711
|
+
source: "result\x0a\x09^result",
|
|
712
|
+
messageSends: [],
|
|
713
|
+
referencedClasses: []
|
|
714
|
+
}),
|
|
715
|
+
smalltalk.TestSuiteRunner);
|
|
716
|
+
|
|
717
|
+
smalltalk.addMethod(
|
|
718
|
+
"_run",
|
|
719
|
+
smalltalk.method({
|
|
720
|
+
selector: "run",
|
|
721
|
+
category: 'actions',
|
|
722
|
+
fn: function (){
|
|
723
|
+
var self=this;
|
|
724
|
+
var worker;
|
|
725
|
+
smalltalk.send(self["@result"],"_total_",[smalltalk.send(self["@suite"],"_size",[])]);
|
|
726
|
+
smalltalk.send(self["@announcer"],"_announce_",[smalltalk.send(smalltalk.send((smalltalk.ResultAnnouncement || ResultAnnouncement),"_new",[]),"_result_",[self["@result"]])]);
|
|
727
|
+
worker=(function(){
|
|
728
|
+
return smalltalk.send(self["@result"],"_nextRunDo_",[(function(index){
|
|
729
|
+
return smalltalk.send((function(){
|
|
730
|
+
return smalltalk.send(self["@result"],"_runCase_",[smalltalk.send(self["@suite"],"_at_",[index])]);
|
|
731
|
+
}),"_ensure_",[(function(){
|
|
732
|
+
smalltalk.send(worker,"_fork",[]);
|
|
733
|
+
return smalltalk.send(self["@announcer"],"_announce_",[smalltalk.send(smalltalk.send((smalltalk.ResultAnnouncement || ResultAnnouncement),"_new",[]),"_result_",[self["@result"]])]);
|
|
734
|
+
})]);
|
|
735
|
+
})]);
|
|
736
|
+
});
|
|
737
|
+
smalltalk.send(worker,"_fork",[]);
|
|
738
|
+
return self},
|
|
739
|
+
args: [],
|
|
740
|
+
source: "run\x0a\x09| worker |\x0a\x09result total: suite size.\x0a announcer announce: (ResultAnnouncement new result: result).\x0a worker := [ result nextRunDo: [ :index |\x0a\x09\x09[ result runCase: (suite at: index) ]\x0a\x09\x09ensure: [ worker fork.\x0a \x09announcer announce: (ResultAnnouncement new result: result) ]]].\x0a\x09worker fork",
|
|
741
|
+
messageSends: ["total:", "size", "announce:", "result:", "new", "nextRunDo:", "ensure:", "fork", "runCase:", "at:"],
|
|
742
|
+
referencedClasses: ["ResultAnnouncement"]
|
|
743
|
+
}),
|
|
744
|
+
smalltalk.TestSuiteRunner);
|
|
745
|
+
|
|
746
|
+
smalltalk.addMethod(
|
|
747
|
+
"_suite_",
|
|
748
|
+
smalltalk.method({
|
|
749
|
+
selector: "suite:",
|
|
750
|
+
category: 'accessing',
|
|
751
|
+
fn: function (aCollection){
|
|
752
|
+
var self=this;
|
|
753
|
+
self["@suite"]=aCollection;
|
|
754
|
+
return self},
|
|
755
|
+
args: ["aCollection"],
|
|
756
|
+
source: "suite: aCollection\x0a\x09suite := aCollection",
|
|
757
|
+
messageSends: [],
|
|
758
|
+
referencedClasses: []
|
|
759
|
+
}),
|
|
760
|
+
smalltalk.TestSuiteRunner);
|
|
761
|
+
|
|
762
|
+
|
|
763
|
+
smalltalk.addMethod(
|
|
764
|
+
"_new",
|
|
765
|
+
smalltalk.method({
|
|
766
|
+
selector: "new",
|
|
767
|
+
category: 'instance creation',
|
|
768
|
+
fn: function (){
|
|
769
|
+
var self=this;
|
|
770
|
+
smalltalk.send(self,"_shouldNotImplement",[]);
|
|
771
|
+
return self},
|
|
772
|
+
args: [],
|
|
773
|
+
source: "new\x0a\x09self shouldNotImplement",
|
|
774
|
+
messageSends: ["shouldNotImplement"],
|
|
775
|
+
referencedClasses: []
|
|
776
|
+
}),
|
|
777
|
+
smalltalk.TestSuiteRunner.klass);
|
|
778
|
+
|
|
779
|
+
smalltalk.addMethod(
|
|
780
|
+
"_on_",
|
|
781
|
+
smalltalk.method({
|
|
782
|
+
selector: "on:",
|
|
783
|
+
category: 'instance creation',
|
|
784
|
+
fn: function (aCollection){
|
|
785
|
+
var self=this;
|
|
786
|
+
var $1;
|
|
787
|
+
$1=smalltalk.send(smalltalk.send(self,"_new",[],smalltalk.Object.klass),"_suite_",[aCollection]);
|
|
788
|
+
return $1;
|
|
789
|
+
},
|
|
790
|
+
args: ["aCollection"],
|
|
791
|
+
source: "on: aCollection\x0a\x09^super new suite: aCollection",
|
|
792
|
+
messageSends: ["suite:", "new"],
|
|
793
|
+
referencedClasses: []
|
|
794
|
+
}),
|
|
795
|
+
smalltalk.TestSuiteRunner.klass);
|
|
796
|
+
|
|
797
|
+
|