SUnit.deploy.js 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785
  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. smalltalk.addMethod(
  14. "_result_",
  15. smalltalk.method({
  16. selector: "result:",
  17. fn: function (aTestResult){
  18. var self=this;
  19. self["@result"]=aTestResult;
  20. return self}
  21. }),
  22. smalltalk.ResultAnnouncement);
  23. smalltalk.addClass('RunningTestContext', smalltalk.Object, ['finished', 'testCase', 'result', 'step'], 'SUnit');
  24. smalltalk.addMethod(
  25. "_exception_ifNotAsync_",
  26. smalltalk.method({
  27. selector: "exception:ifNotAsync:",
  28. fn: function (anException,aBlock){
  29. var self=this;
  30. var $1;
  31. $1=smalltalk.send(self["@testCase"],"_isAsync",[]);
  32. if(smalltalk.assert($1)){
  33. self["@step"]=(function(){
  34. smalltalk.send(self["@testCase"],"_finished",[]);
  35. return smalltalk.send(anException,"_signal",[]);
  36. });
  37. self["@step"];
  38. } else {
  39. smalltalk.send(aBlock,"_value",[]);
  40. };
  41. return self}
  42. }),
  43. smalltalk.RunningTestContext);
  44. smalltalk.addMethod(
  45. "_execute_",
  46. smalltalk.method({
  47. selector: "execute:",
  48. fn: function (aBlock){
  49. var self=this;
  50. var $1,$2;
  51. self["@step"]=aBlock;
  52. smalltalk.send((function(){
  53. return smalltalk.send(self["@step"],"_isNil",[]);
  54. }),"_whileFalse_",[(function(){
  55. smalltalk.send(self["@testCase"],"_context_",[self]);
  56. return smalltalk.send((function(){
  57. return smalltalk.send((function(){
  58. return smalltalk.send((function(){
  59. return smalltalk.send(self["@step"],"_ensure_",[(function(){
  60. smalltalk.send(self["@testCase"],"_context_",[nil]);
  61. self["@step"]=nil;
  62. self["@step"];
  63. $1=smalltalk.send(self["@testCase"],"_isAsync",[]);
  64. if(! smalltalk.assert($1)){
  65. return smalltalk.send(self["@testCase"],"_tearDown",[]);
  66. };
  67. })]);
  68. }),"_on_do_",[(smalltalk.TestFailure || TestFailure),(function(ex){
  69. return smalltalk.send(self,"_exception_ifNotAsync_",[ex,(function(){
  70. return smalltalk.send(self["@result"],"_addFailure_",[self["@testCase"]]);
  71. })]);
  72. })]);
  73. }),"_on_do_",[(smalltalk.Error || Error),(function(ex){
  74. return smalltalk.send(self,"_exception_ifNotAsync_",[ex,(function(){
  75. return smalltalk.send(self["@result"],"_addError_",[self["@testCase"]]);
  76. })]);
  77. })]);
  78. }),"_ensure_",[(function(){
  79. $2=smalltalk.send(self["@testCase"],"_isAsync",[]);
  80. if(! smalltalk.assert($2)){
  81. smalltalk.send(self["@result"],"_increaseRuns",[]);
  82. return smalltalk.send(self["@finished"],"_value",[]);
  83. };
  84. })]);
  85. })]);
  86. return self}
  87. }),
  88. smalltalk.RunningTestContext);
  89. smalltalk.addMethod(
  90. "_finished_",
  91. smalltalk.method({
  92. selector: "finished:",
  93. fn: function (aBlock){
  94. var self=this;
  95. self["@finished"]=aBlock;
  96. return self}
  97. }),
  98. smalltalk.RunningTestContext);
  99. smalltalk.addMethod(
  100. "_result_",
  101. smalltalk.method({
  102. selector: "result:",
  103. fn: function (aTestResult){
  104. var self=this;
  105. self["@result"]=aTestResult;
  106. return self}
  107. }),
  108. smalltalk.RunningTestContext);
  109. smalltalk.addMethod(
  110. "_start",
  111. smalltalk.method({
  112. selector: "start",
  113. fn: function (){
  114. var self=this;
  115. smalltalk.send(self,"_execute_",[(function(){
  116. smalltalk.send(self["@testCase"],"_setUp",[]);
  117. return smalltalk.send(self["@testCase"],"_performTest",[]);
  118. })]);
  119. return self}
  120. }),
  121. smalltalk.RunningTestContext);
  122. smalltalk.addMethod(
  123. "_testCase_",
  124. smalltalk.method({
  125. selector: "testCase:",
  126. fn: function (aTestCase){
  127. var self=this;
  128. self["@testCase"]=aTestCase;
  129. return self}
  130. }),
  131. smalltalk.RunningTestContext);
  132. smalltalk.addMethod(
  133. "_testCase_result_finished_",
  134. smalltalk.method({
  135. selector: "testCase:result:finished:",
  136. fn: function (aTestCase,aTestResult,aBlock){
  137. var self=this;
  138. var $2,$3,$1;
  139. $2=smalltalk.send(self,"_new",[]);
  140. smalltalk.send($2,"_testCase_",[aTestCase]);
  141. smalltalk.send($2,"_result_",[aTestResult]);
  142. smalltalk.send($2,"_finished_",[aBlock]);
  143. $3=smalltalk.send($2,"_yourself",[]);
  144. $1=$3;
  145. return $1;
  146. }
  147. }),
  148. smalltalk.RunningTestContext.klass);
  149. smalltalk.addClass('TestCase', smalltalk.Object, ['testSelector', 'asyncTimeout', 'context'], 'SUnit');
  150. smalltalk.addMethod(
  151. "_assert_",
  152. smalltalk.method({
  153. selector: "assert:",
  154. fn: function (aBoolean) {
  155. var self = this;
  156. smalltalk.send(self, "_assert_description_", [aBoolean, "Assertion failed"]);
  157. return self;
  158. }
  159. }),
  160. smalltalk.TestCase);
  161. smalltalk.addMethod(
  162. "_assert_description_",
  163. smalltalk.method({
  164. selector: "assert:description:",
  165. fn: function (aBoolean, aString) {
  166. var self = this;
  167. if (!smalltalk.assert(aBoolean)) {
  168. smalltalk.send(self, "_signalFailure_", [aString]);
  169. }
  170. return self;
  171. }
  172. }),
  173. smalltalk.TestCase);
  174. smalltalk.addMethod(
  175. "_assert_equals_",
  176. smalltalk.method({
  177. selector: "assert:equals:",
  178. fn: function (expected, actual) {
  179. var self = this;
  180. var $1;
  181. $1 = smalltalk.send(self, "_assert_description_", [smalltalk.send(expected, "__eq", [actual]), smalltalk.send(smalltalk.send(smalltalk.send("Expected: ", "__comma", [smalltalk.send(expected, "_asString", [])]), "__comma", [" but was: "]), "__comma", [smalltalk.send(actual, "_asString", [])])]);
  182. return $1;
  183. }
  184. }),
  185. smalltalk.TestCase);
  186. smalltalk.addMethod(
  187. "_async_",
  188. smalltalk.method({
  189. selector: "async:",
  190. fn: function (aBlock){
  191. var self=this;
  192. var $1;
  193. var c;
  194. smalltalk.send(self,"_mustBeAsync_",["#async"]);
  195. c=self["@context"];
  196. $1=(function(){
  197. return smalltalk.send(c,"_execute_",[aBlock]);
  198. });
  199. return $1;
  200. }
  201. }),
  202. smalltalk.TestCase);
  203. smalltalk.addMethod(
  204. "_context_",
  205. smalltalk.method({
  206. selector: "context:",
  207. fn: function (aRunningTestContext){
  208. var self=this;
  209. self["@context"]=aRunningTestContext;
  210. return self}
  211. }),
  212. smalltalk.TestCase);
  213. smalltalk.addMethod(
  214. "_deny_",
  215. smalltalk.method({
  216. selector: "deny:",
  217. fn: function (aBoolean) {
  218. var self = this;
  219. smalltalk.send(self, "_assert_", [smalltalk.send(aBoolean, "_not", [])]);
  220. return self;
  221. }
  222. }),
  223. smalltalk.TestCase);
  224. smalltalk.addMethod(
  225. "_finished",
  226. smalltalk.method({
  227. selector: "finished",
  228. fn: function (){
  229. var self=this;
  230. smalltalk.send(self,"_mustBeAsync_",["#finished"]);
  231. self["@asyncTimeout"]=nil;
  232. return self}
  233. }),
  234. smalltalk.TestCase);
  235. smalltalk.addMethod(
  236. "_graceTime_",
  237. smalltalk.method({
  238. selector: "graceTime:",
  239. fn: function (millis){
  240. var self=this;
  241. self["@asyncTimeout"]=true;
  242. return self}
  243. }),
  244. smalltalk.TestCase);
  245. smalltalk.addMethod(
  246. "_isAsync",
  247. smalltalk.method({
  248. selector: "isAsync",
  249. fn: function (){
  250. var self=this;
  251. var $1;
  252. $1=smalltalk.send(self["@asyncTimeout"],"_notNil",[]);
  253. return $1;
  254. }
  255. }),
  256. smalltalk.TestCase);
  257. smalltalk.addMethod(
  258. "_mustBeAsync_",
  259. smalltalk.method({
  260. selector: "mustBeAsync:",
  261. fn: function (aString){
  262. var self=this;
  263. var $1;
  264. $1=smalltalk.send(self,"_isAsync",[]);
  265. if(! smalltalk.assert($1)){
  266. smalltalk.send(self,"_error_",[smalltalk.send(aString,"__comma",[" used without prior #graceTime:"])]);
  267. };
  268. return self}
  269. }),
  270. smalltalk.TestCase);
  271. smalltalk.addMethod(
  272. "_performTest",
  273. smalltalk.method({
  274. selector: "performTest",
  275. fn: function (){
  276. var self=this;
  277. self["@asyncTimeout"]=nil;
  278. smalltalk.send(self,"_perform_",[smalltalk.send(self,"_selector",[])]);
  279. return self}
  280. }),
  281. smalltalk.TestCase);
  282. smalltalk.addMethod(
  283. "_runCase",
  284. smalltalk.method({
  285. selector: "runCase",
  286. fn: function (){
  287. var self=this;
  288. smalltalk.send((function(){
  289. smalltalk.send(self,"_setUp",[]);
  290. return smalltalk.send(self,"_performTest",[]);
  291. }),"_ensure_",[(function(){
  292. return smalltalk.send(self,"_tearDown",[]);
  293. })]);
  294. return self}
  295. }),
  296. smalltalk.TestCase);
  297. smalltalk.addMethod(
  298. "_selector",
  299. smalltalk.method({
  300. selector: "selector",
  301. fn: function () {
  302. var self = this;
  303. return self['@testSelector'];
  304. }
  305. }),
  306. smalltalk.TestCase);
  307. smalltalk.addMethod(
  308. "_setTestSelector_",
  309. smalltalk.method({
  310. selector: "setTestSelector:",
  311. fn: function (aSelector) {
  312. var self = this;
  313. self['@testSelector'] = aSelector;
  314. return self;
  315. }
  316. }),
  317. smalltalk.TestCase);
  318. smalltalk.addMethod(
  319. "_setUp",
  320. smalltalk.method({
  321. selector: "setUp",
  322. fn: function () {
  323. var self = this;
  324. return self;
  325. }
  326. }),
  327. smalltalk.TestCase);
  328. smalltalk.addMethod(
  329. "_should_",
  330. smalltalk.method({
  331. selector: "should:",
  332. fn: function (aBlock) {
  333. var self = this;
  334. smalltalk.send(self, "_assert_", [smalltalk.send(aBlock, "_value", [])]);
  335. return self;
  336. }
  337. }),
  338. smalltalk.TestCase);
  339. smalltalk.addMethod(
  340. "_should_raise_",
  341. smalltalk.method({
  342. selector: "should:raise:",
  343. fn: function (aBlock, anExceptionClass) {
  344. var self = this;
  345. smalltalk.send(self, "_assert_", [smalltalk.send(function () {smalltalk.send(aBlock, "_value", []);return false;}, "_on_do_", [anExceptionClass, function (ex) {return true;}])]);
  346. return self;
  347. }
  348. }),
  349. smalltalk.TestCase);
  350. smalltalk.addMethod(
  351. "_shouldnt_raise_",
  352. smalltalk.method({
  353. selector: "shouldnt:raise:",
  354. fn: function (aBlock, anExceptionClass) {
  355. var self = this;
  356. smalltalk.send(self, "_assert_", [smalltalk.send(function () {smalltalk.send(aBlock, "_value", []);return true;}, "_on_do_", [anExceptionClass, function (ex) {return false;}])]);
  357. return self;
  358. }
  359. }),
  360. smalltalk.TestCase);
  361. smalltalk.addMethod(
  362. "_signalFailure_",
  363. smalltalk.method({
  364. selector: "signalFailure:",
  365. fn: function (aString) {
  366. var self = this;
  367. var $1, $2;
  368. $1 = smalltalk.send(smalltalk.TestFailure || TestFailure, "_new", []);
  369. smalltalk.send($1, "_messageText_", [aString]);
  370. $2 = smalltalk.send($1, "_signal", []);
  371. return self;
  372. }
  373. }),
  374. smalltalk.TestCase);
  375. smalltalk.addMethod(
  376. "_tearDown",
  377. smalltalk.method({
  378. selector: "tearDown",
  379. fn: function () {
  380. var self = this;
  381. return self;
  382. }
  383. }),
  384. smalltalk.TestCase);
  385. smalltalk.addMethod(
  386. "_allTestSelectors",
  387. smalltalk.method({
  388. selector: "allTestSelectors",
  389. fn: function () {
  390. var self = this;
  391. var $1;
  392. var selectors;
  393. selectors = smalltalk.send(self, "_testSelectors", []);
  394. $1 = smalltalk.send(self, "_shouldInheritSelectors", []);
  395. if (smalltalk.assert($1)) {
  396. smalltalk.send(selectors, "_addAll_", [smalltalk.send(smalltalk.send(self, "_superclass", []), "_allTestSelectors", [])]);
  397. }
  398. return selectors;
  399. }
  400. }),
  401. smalltalk.TestCase.klass);
  402. smalltalk.addMethod(
  403. "_buildSuite",
  404. smalltalk.method({
  405. selector: "buildSuite",
  406. fn: function () {
  407. var self = this;
  408. var $1;
  409. $1 = smalltalk.send(smalltalk.send(self, "_allTestSelectors", []), "_collect_", [function (each) {return smalltalk.send(self, "_selector_", [each]);}]);
  410. return $1;
  411. }
  412. }),
  413. smalltalk.TestCase.klass);
  414. smalltalk.addMethod(
  415. "_isAbstract",
  416. smalltalk.method({
  417. selector: "isAbstract",
  418. fn: function () {
  419. var self = this;
  420. var $1;
  421. $1 = smalltalk.send(smalltalk.send(self, "_name", []), "__eq", ["TestCase"]);
  422. return $1;
  423. }
  424. }),
  425. smalltalk.TestCase.klass);
  426. smalltalk.addMethod(
  427. "_lookupHierarchyRoot",
  428. smalltalk.method({
  429. selector: "lookupHierarchyRoot",
  430. fn: function () {
  431. var self = this;
  432. return smalltalk.TestCase || TestCase;
  433. }
  434. }),
  435. smalltalk.TestCase.klass);
  436. smalltalk.addMethod(
  437. "_selector_",
  438. smalltalk.method({
  439. selector: "selector:",
  440. fn: function (aSelector) {
  441. var self = this;
  442. var $2, $3, $1;
  443. $2 = smalltalk.send(self, "_new", []);
  444. smalltalk.send($2, "_setTestSelector_", [aSelector]);
  445. $3 = smalltalk.send($2, "_yourself", []);
  446. $1 = $3;
  447. return $1;
  448. }
  449. }),
  450. smalltalk.TestCase.klass);
  451. smalltalk.addMethod(
  452. "_shouldInheritSelectors",
  453. smalltalk.method({
  454. selector: "shouldInheritSelectors",
  455. fn: function () {
  456. var self = this;
  457. var $1;
  458. $1 = smalltalk.send(self, "_~_eq", [smalltalk.send(self, "_lookupHierarchyRoot", [])]);
  459. return $1;
  460. }
  461. }),
  462. smalltalk.TestCase.klass);
  463. smalltalk.addMethod(
  464. "_testSelectors",
  465. smalltalk.method({
  466. selector: "testSelectors",
  467. fn: function () {
  468. var self = this;
  469. var $1;
  470. $1 = smalltalk.send(smalltalk.send(smalltalk.send(self, "_methodDictionary", []), "_keys", []), "_select_", [function (each) {return smalltalk.send(each, "_match_", ["^test"]);}]);
  471. return $1;
  472. }
  473. }),
  474. smalltalk.TestCase.klass);
  475. smalltalk.addClass('TestFailure', smalltalk.Error, [], 'SUnit');
  476. smalltalk.addClass('TestResult', smalltalk.Object, ['timestamp', 'runs', 'errors', 'failures', 'total'], 'SUnit');
  477. smalltalk.addMethod(
  478. "_addError_",
  479. smalltalk.method({
  480. selector: "addError:",
  481. fn: function (anError) {
  482. var self = this;
  483. smalltalk.send(smalltalk.send(self, "_errors", []), "_add_", [anError]);
  484. return self;
  485. }
  486. }),
  487. smalltalk.TestResult);
  488. smalltalk.addMethod(
  489. "_addFailure_",
  490. smalltalk.method({
  491. selector: "addFailure:",
  492. fn: function (aFailure) {
  493. var self = this;
  494. smalltalk.send(smalltalk.send(self, "_failures", []), "_add_", [aFailure]);
  495. return self;
  496. }
  497. }),
  498. smalltalk.TestResult);
  499. smalltalk.addMethod(
  500. "_errors",
  501. smalltalk.method({
  502. selector: "errors",
  503. fn: function () {
  504. var self = this;
  505. return self['@errors'];
  506. }
  507. }),
  508. smalltalk.TestResult);
  509. smalltalk.addMethod(
  510. "_failures",
  511. smalltalk.method({
  512. selector: "failures",
  513. fn: function () {
  514. var self = this;
  515. return self['@failures'];
  516. }
  517. }),
  518. smalltalk.TestResult);
  519. smalltalk.addMethod(
  520. "_increaseRuns",
  521. smalltalk.method({
  522. selector: "increaseRuns",
  523. fn: function () {
  524. var self = this;
  525. self['@runs'] = smalltalk.send(self['@runs'], "__plus", [1]);
  526. return self;
  527. }
  528. }),
  529. smalltalk.TestResult);
  530. smalltalk.addMethod(
  531. "_initialize",
  532. smalltalk.method({
  533. selector: "initialize",
  534. fn: function () {
  535. var self = this;
  536. smalltalk.send(self, "_initialize", [], smalltalk.Object);
  537. self['@timestamp'] = smalltalk.send(smalltalk.Date || Date, "_now", []);
  538. self['@runs'] = 0;
  539. self['@errors'] = smalltalk.send(smalltalk.Array || Array, "_new", []);
  540. self['@failures'] = smalltalk.send(smalltalk.Array || Array, "_new", []);
  541. self['@total'] = 0;
  542. return self;
  543. }
  544. }),
  545. smalltalk.TestResult);
  546. smalltalk.addMethod(
  547. "_nextRunDo_",
  548. smalltalk.method({
  549. selector: "nextRunDo:",
  550. fn: function (aBlock){
  551. var self=this;
  552. var $2,$1;
  553. $2=smalltalk.send(smalltalk.send(self,"_runs",[]),"__eq_eq",[smalltalk.send(self,"_total",[])]);
  554. if(! smalltalk.assert($2)){
  555. $1=smalltalk.send(aBlock,"_value_",[smalltalk.send(smalltalk.send(self,"_runs",[]),"__plus",[(1)])]);
  556. };
  557. return $1;
  558. }
  559. }),
  560. smalltalk.TestResult);
  561. smalltalk.addMethod(
  562. "_runs",
  563. smalltalk.method({
  564. selector: "runs",
  565. fn: function () {
  566. var self = this;
  567. return self['@runs'];
  568. }
  569. }),
  570. smalltalk.TestResult);
  571. smalltalk.addMethod(
  572. "_status",
  573. smalltalk.method({
  574. selector: "status",
  575. fn: function () {
  576. var self = this;
  577. var $2, $3, $1;
  578. $2 = smalltalk.send(smalltalk.send(self, "_errors", []), "_isEmpty", []);
  579. if (smalltalk.assert($2)) {
  580. $3 = smalltalk.send(smalltalk.send(self, "_failures", []), "_isEmpty", []);
  581. if (smalltalk.assert($3)) {
  582. $1 = "success";
  583. } else {
  584. $1 = "failure";
  585. }
  586. } else {
  587. $1 = "error";
  588. }
  589. return $1;
  590. }
  591. }),
  592. smalltalk.TestResult);
  593. smalltalk.addMethod(
  594. "_timestamp",
  595. smalltalk.method({
  596. selector: "timestamp",
  597. fn: function () {
  598. var self = this;
  599. return self['@timestamp'];
  600. }
  601. }),
  602. smalltalk.TestResult);
  603. smalltalk.addMethod(
  604. "_total",
  605. smalltalk.method({
  606. selector: "total",
  607. fn: function () {
  608. var self = this;
  609. return self['@total'];
  610. }
  611. }),
  612. smalltalk.TestResult);
  613. smalltalk.addMethod(
  614. "_total_",
  615. smalltalk.method({
  616. selector: "total:",
  617. fn: function (aNumber) {
  618. var self = this;
  619. self['@total'] = aNumber;
  620. return self;
  621. }
  622. }),
  623. smalltalk.TestResult);
  624. smalltalk.addClass('TestSuiteRunner', smalltalk.Object, ['suite', 'result', 'announcer', 'runNextTest'], 'SUnit');
  625. smalltalk.addMethod(
  626. "_announcer",
  627. smalltalk.method({
  628. selector: "announcer",
  629. fn: function (){
  630. var self=this;
  631. return self["@announcer"];
  632. }
  633. }),
  634. smalltalk.TestSuiteRunner);
  635. smalltalk.addMethod(
  636. "_initialize",
  637. smalltalk.method({
  638. selector: "initialize",
  639. fn: function (){
  640. var self=this;
  641. smalltalk.send(self,"_initialize",[],smalltalk.Object);
  642. self["@announcer"]=smalltalk.send((smalltalk.Announcer || Announcer),"_new",[]);
  643. self["@result"]=smalltalk.send((smalltalk.TestResult || TestResult),"_new",[]);
  644. self["@runNextTest"]=(function(){
  645. return smalltalk.send(self["@result"],"_nextRunDo_",[(function(index){
  646. return smalltalk.send(smalltalk.send((smalltalk.RunningTestContext || RunningTestContext),"_testCase_result_finished_",[smalltalk.send(self["@suite"],"_at_",[index]),self["@result"],(function(){
  647. return smalltalk.send(self,"_resume",[]);
  648. })]),"_start",[]);
  649. })]);
  650. });
  651. return self}
  652. }),
  653. smalltalk.TestSuiteRunner);
  654. smalltalk.addMethod(
  655. "_result",
  656. smalltalk.method({
  657. selector: "result",
  658. fn: function (){
  659. var self=this;
  660. return self["@result"];
  661. }
  662. }),
  663. smalltalk.TestSuiteRunner);
  664. smalltalk.addMethod(
  665. "_resume",
  666. smalltalk.method({
  667. selector: "resume",
  668. fn: function (){
  669. var self=this;
  670. smalltalk.send(self["@runNextTest"],"_fork",[]);
  671. smalltalk.send(self["@announcer"],"_announce_",[smalltalk.send(smalltalk.send((smalltalk.ResultAnnouncement || ResultAnnouncement),"_new",[]),"_result_",[self["@result"]])]);
  672. return self}
  673. }),
  674. smalltalk.TestSuiteRunner);
  675. smalltalk.addMethod(
  676. "_run",
  677. smalltalk.method({
  678. selector: "run",
  679. fn: function (){
  680. var self=this;
  681. smalltalk.send(self["@result"],"_total_",[smalltalk.send(self["@suite"],"_size",[])]);
  682. smalltalk.send(self,"_resume",[]);
  683. return self}
  684. }),
  685. smalltalk.TestSuiteRunner);
  686. smalltalk.addMethod(
  687. "_suite_",
  688. smalltalk.method({
  689. selector: "suite:",
  690. fn: function (aCollection){
  691. var self=this;
  692. self["@suite"]=aCollection;
  693. return self}
  694. }),
  695. smalltalk.TestSuiteRunner);
  696. smalltalk.addMethod(
  697. "_new",
  698. smalltalk.method({
  699. selector: "new",
  700. fn: function (){
  701. var self=this;
  702. smalltalk.send(self,"_shouldNotImplement",[]);
  703. return self}
  704. }),
  705. smalltalk.TestSuiteRunner.klass);
  706. smalltalk.addMethod(
  707. "_on_",
  708. smalltalk.method({
  709. selector: "on:",
  710. fn: function (aCollection){
  711. var self=this;
  712. var $1;
  713. $1=smalltalk.send(smalltalk.send(self,"_new",[],smalltalk.Object.klass),"_suite_",[aCollection]);
  714. return $1;
  715. }
  716. }),
  717. smalltalk.TestSuiteRunner.klass);