SUnit.deploy.js 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790
  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 $2,$1;
  193. var c;
  194. smalltalk.send(self,"_mustBeAsync_",["#async"]);
  195. c=self["@context"];
  196. $1=(function(){
  197. $2=smalltalk.send(self,"_isAsync",[]);
  198. if(smalltalk.assert($2)){
  199. return smalltalk.send(c,"_execute_",[aBlock]);
  200. };
  201. });
  202. return $1;
  203. }
  204. }),
  205. smalltalk.TestCase);
  206. smalltalk.addMethod(
  207. "_context_",
  208. smalltalk.method({
  209. selector: "context:",
  210. fn: function (aRunningTestContext){
  211. var self=this;
  212. self["@context"]=aRunningTestContext;
  213. return self}
  214. }),
  215. smalltalk.TestCase);
  216. smalltalk.addMethod(
  217. "_deny_",
  218. smalltalk.method({
  219. selector: "deny:",
  220. fn: function (aBoolean) {
  221. var self = this;
  222. smalltalk.send(self, "_assert_", [smalltalk.send(aBoolean, "_not", [])]);
  223. return self;
  224. }
  225. }),
  226. smalltalk.TestCase);
  227. smalltalk.addMethod(
  228. "_finished",
  229. smalltalk.method({
  230. selector: "finished",
  231. fn: function (){
  232. var self=this;
  233. smalltalk.send(self,"_mustBeAsync_",["#finished"]);
  234. self["@asyncTimeout"]=nil;
  235. return self}
  236. }),
  237. smalltalk.TestCase);
  238. smalltalk.addMethod(
  239. "_graceTime_",
  240. smalltalk.method({
  241. selector: "graceTime:",
  242. fn: function (millis){
  243. var self=this;
  244. self["@asyncTimeout"]=true;
  245. return self}
  246. }),
  247. smalltalk.TestCase);
  248. smalltalk.addMethod(
  249. "_isAsync",
  250. smalltalk.method({
  251. selector: "isAsync",
  252. fn: function (){
  253. var self=this;
  254. var $1;
  255. $1=smalltalk.send(self["@asyncTimeout"],"_notNil",[]);
  256. return $1;
  257. }
  258. }),
  259. smalltalk.TestCase);
  260. smalltalk.addMethod(
  261. "_mustBeAsync_",
  262. smalltalk.method({
  263. selector: "mustBeAsync:",
  264. fn: function (aString){
  265. var self=this;
  266. var $1;
  267. $1=smalltalk.send(self,"_isAsync",[]);
  268. if(! smalltalk.assert($1)){
  269. smalltalk.send(self,"_error_",[smalltalk.send(aString,"__comma",[" used without prior #graceTime:"])]);
  270. };
  271. return self}
  272. }),
  273. smalltalk.TestCase);
  274. smalltalk.addMethod(
  275. "_performTest",
  276. smalltalk.method({
  277. selector: "performTest",
  278. fn: function (){
  279. var self=this;
  280. self["@asyncTimeout"]=nil;
  281. smalltalk.send(self,"_perform_",[smalltalk.send(self,"_selector",[])]);
  282. return self}
  283. }),
  284. smalltalk.TestCase);
  285. smalltalk.addMethod(
  286. "_runCase",
  287. smalltalk.method({
  288. selector: "runCase",
  289. fn: function (){
  290. var self=this;
  291. smalltalk.send((function(){
  292. smalltalk.send(self,"_setUp",[]);
  293. return smalltalk.send(self,"_performTest",[]);
  294. }),"_ensure_",[(function(){
  295. return smalltalk.send(self,"_tearDown",[]);
  296. })]);
  297. return self}
  298. }),
  299. smalltalk.TestCase);
  300. smalltalk.addMethod(
  301. "_selector",
  302. smalltalk.method({
  303. selector: "selector",
  304. fn: function () {
  305. var self = this;
  306. return self['@testSelector'];
  307. }
  308. }),
  309. smalltalk.TestCase);
  310. smalltalk.addMethod(
  311. "_setTestSelector_",
  312. smalltalk.method({
  313. selector: "setTestSelector:",
  314. fn: function (aSelector) {
  315. var self = this;
  316. self['@testSelector'] = aSelector;
  317. return self;
  318. }
  319. }),
  320. smalltalk.TestCase);
  321. smalltalk.addMethod(
  322. "_setUp",
  323. smalltalk.method({
  324. selector: "setUp",
  325. fn: function () {
  326. var self = this;
  327. return self;
  328. }
  329. }),
  330. smalltalk.TestCase);
  331. smalltalk.addMethod(
  332. "_should_",
  333. smalltalk.method({
  334. selector: "should:",
  335. fn: function (aBlock) {
  336. var self = this;
  337. smalltalk.send(self, "_assert_", [smalltalk.send(aBlock, "_value", [])]);
  338. return self;
  339. }
  340. }),
  341. smalltalk.TestCase);
  342. smalltalk.addMethod(
  343. "_should_raise_",
  344. smalltalk.method({
  345. selector: "should:raise:",
  346. fn: function (aBlock, anExceptionClass) {
  347. var self = this;
  348. smalltalk.send(self, "_assert_", [smalltalk.send(function () {smalltalk.send(aBlock, "_value", []);return false;}, "_on_do_", [anExceptionClass, function (ex) {return true;}])]);
  349. return self;
  350. }
  351. }),
  352. smalltalk.TestCase);
  353. smalltalk.addMethod(
  354. "_shouldnt_raise_",
  355. smalltalk.method({
  356. selector: "shouldnt:raise:",
  357. fn: function (aBlock, anExceptionClass) {
  358. var self = this;
  359. smalltalk.send(self, "_assert_", [smalltalk.send(function () {smalltalk.send(aBlock, "_value", []);return true;}, "_on_do_", [anExceptionClass, function (ex) {return false;}])]);
  360. return self;
  361. }
  362. }),
  363. smalltalk.TestCase);
  364. smalltalk.addMethod(
  365. "_signalFailure_",
  366. smalltalk.method({
  367. selector: "signalFailure:",
  368. fn: function (aString) {
  369. var self = this;
  370. var $1, $2;
  371. $1 = smalltalk.send(smalltalk.TestFailure || TestFailure, "_new", []);
  372. smalltalk.send($1, "_messageText_", [aString]);
  373. $2 = smalltalk.send($1, "_signal", []);
  374. return self;
  375. }
  376. }),
  377. smalltalk.TestCase);
  378. smalltalk.addMethod(
  379. "_tearDown",
  380. smalltalk.method({
  381. selector: "tearDown",
  382. fn: function () {
  383. var self = this;
  384. return self;
  385. }
  386. }),
  387. smalltalk.TestCase);
  388. smalltalk.addMethod(
  389. "_allTestSelectors",
  390. smalltalk.method({
  391. selector: "allTestSelectors",
  392. fn: function () {
  393. var self = this;
  394. var $1;
  395. var selectors;
  396. selectors = smalltalk.send(self, "_testSelectors", []);
  397. $1 = smalltalk.send(self, "_shouldInheritSelectors", []);
  398. if (smalltalk.assert($1)) {
  399. smalltalk.send(selectors, "_addAll_", [smalltalk.send(smalltalk.send(self, "_superclass", []), "_allTestSelectors", [])]);
  400. }
  401. return selectors;
  402. }
  403. }),
  404. smalltalk.TestCase.klass);
  405. smalltalk.addMethod(
  406. "_buildSuite",
  407. smalltalk.method({
  408. selector: "buildSuite",
  409. fn: function () {
  410. var self = this;
  411. var $1;
  412. $1 = smalltalk.send(smalltalk.send(self, "_allTestSelectors", []), "_collect_", [function (each) {return smalltalk.send(self, "_selector_", [each]);}]);
  413. return $1;
  414. }
  415. }),
  416. smalltalk.TestCase.klass);
  417. smalltalk.addMethod(
  418. "_isAbstract",
  419. smalltalk.method({
  420. selector: "isAbstract",
  421. fn: function () {
  422. var self = this;
  423. var $1;
  424. $1 = smalltalk.send(smalltalk.send(self, "_name", []), "__eq", ["TestCase"]);
  425. return $1;
  426. }
  427. }),
  428. smalltalk.TestCase.klass);
  429. smalltalk.addMethod(
  430. "_lookupHierarchyRoot",
  431. smalltalk.method({
  432. selector: "lookupHierarchyRoot",
  433. fn: function () {
  434. var self = this;
  435. return smalltalk.TestCase || TestCase;
  436. }
  437. }),
  438. smalltalk.TestCase.klass);
  439. smalltalk.addMethod(
  440. "_selector_",
  441. smalltalk.method({
  442. selector: "selector:",
  443. fn: function (aSelector) {
  444. var self = this;
  445. var $2, $3, $1;
  446. $2 = smalltalk.send(self, "_new", []);
  447. smalltalk.send($2, "_setTestSelector_", [aSelector]);
  448. $3 = smalltalk.send($2, "_yourself", []);
  449. $1 = $3;
  450. return $1;
  451. }
  452. }),
  453. smalltalk.TestCase.klass);
  454. smalltalk.addMethod(
  455. "_shouldInheritSelectors",
  456. smalltalk.method({
  457. selector: "shouldInheritSelectors",
  458. fn: function () {
  459. var self = this;
  460. var $1;
  461. $1 = smalltalk.send(self, "_~_eq", [smalltalk.send(self, "_lookupHierarchyRoot", [])]);
  462. return $1;
  463. }
  464. }),
  465. smalltalk.TestCase.klass);
  466. smalltalk.addMethod(
  467. "_testSelectors",
  468. smalltalk.method({
  469. selector: "testSelectors",
  470. fn: function () {
  471. var self = this;
  472. var $1;
  473. $1 = smalltalk.send(smalltalk.send(smalltalk.send(self, "_methodDictionary", []), "_keys", []), "_select_", [function (each) {return smalltalk.send(each, "_match_", ["^test"]);}]);
  474. return $1;
  475. }
  476. }),
  477. smalltalk.TestCase.klass);
  478. smalltalk.addClass('TestFailure', smalltalk.Error, [], 'SUnit');
  479. smalltalk.addClass('TestResult', smalltalk.Object, ['timestamp', 'runs', 'errors', 'failures', 'total'], 'SUnit');
  480. smalltalk.addMethod(
  481. "_addError_",
  482. smalltalk.method({
  483. selector: "addError:",
  484. fn: function (anError) {
  485. var self = this;
  486. smalltalk.send(smalltalk.send(self, "_errors", []), "_add_", [anError]);
  487. return self;
  488. }
  489. }),
  490. smalltalk.TestResult);
  491. smalltalk.addMethod(
  492. "_addFailure_",
  493. smalltalk.method({
  494. selector: "addFailure:",
  495. fn: function (aFailure) {
  496. var self = this;
  497. smalltalk.send(smalltalk.send(self, "_failures", []), "_add_", [aFailure]);
  498. return self;
  499. }
  500. }),
  501. smalltalk.TestResult);
  502. smalltalk.addMethod(
  503. "_errors",
  504. smalltalk.method({
  505. selector: "errors",
  506. fn: function () {
  507. var self = this;
  508. return self['@errors'];
  509. }
  510. }),
  511. smalltalk.TestResult);
  512. smalltalk.addMethod(
  513. "_failures",
  514. smalltalk.method({
  515. selector: "failures",
  516. fn: function () {
  517. var self = this;
  518. return self['@failures'];
  519. }
  520. }),
  521. smalltalk.TestResult);
  522. smalltalk.addMethod(
  523. "_increaseRuns",
  524. smalltalk.method({
  525. selector: "increaseRuns",
  526. fn: function () {
  527. var self = this;
  528. self['@runs'] = smalltalk.send(self['@runs'], "__plus", [1]);
  529. return self;
  530. }
  531. }),
  532. smalltalk.TestResult);
  533. smalltalk.addMethod(
  534. "_initialize",
  535. smalltalk.method({
  536. selector: "initialize",
  537. fn: function () {
  538. var self = this;
  539. smalltalk.send(self, "_initialize", [], smalltalk.Object);
  540. self['@timestamp'] = smalltalk.send(smalltalk.Date || Date, "_now", []);
  541. self['@runs'] = 0;
  542. self['@errors'] = smalltalk.send(smalltalk.Array || Array, "_new", []);
  543. self['@failures'] = smalltalk.send(smalltalk.Array || Array, "_new", []);
  544. self['@total'] = 0;
  545. return self;
  546. }
  547. }),
  548. smalltalk.TestResult);
  549. smalltalk.addMethod(
  550. "_runs",
  551. smalltalk.method({
  552. selector: "runs",
  553. fn: function () {
  554. var self = this;
  555. return self['@runs'];
  556. }
  557. }),
  558. smalltalk.TestResult);
  559. smalltalk.addMethod(
  560. "_status",
  561. smalltalk.method({
  562. selector: "status",
  563. fn: function () {
  564. var self = this;
  565. var $2, $3, $1;
  566. $2 = smalltalk.send(smalltalk.send(self, "_errors", []), "_isEmpty", []);
  567. if (smalltalk.assert($2)) {
  568. $3 = smalltalk.send(smalltalk.send(self, "_failures", []), "_isEmpty", []);
  569. if (smalltalk.assert($3)) {
  570. $1 = "success";
  571. } else {
  572. $1 = "failure";
  573. }
  574. } else {
  575. $1 = "error";
  576. }
  577. return $1;
  578. }
  579. }),
  580. smalltalk.TestResult);
  581. smalltalk.addMethod(
  582. "_timestamp",
  583. smalltalk.method({
  584. selector: "timestamp",
  585. fn: function () {
  586. var self = this;
  587. return self['@timestamp'];
  588. }
  589. }),
  590. smalltalk.TestResult);
  591. smalltalk.addMethod(
  592. "_total",
  593. smalltalk.method({
  594. selector: "total",
  595. fn: function () {
  596. var self = this;
  597. return self['@total'];
  598. }
  599. }),
  600. smalltalk.TestResult);
  601. smalltalk.addMethod(
  602. "_total_",
  603. smalltalk.method({
  604. selector: "total:",
  605. fn: function (aNumber) {
  606. var self = this;
  607. self['@total'] = aNumber;
  608. return self;
  609. }
  610. }),
  611. smalltalk.TestResult);
  612. smalltalk.addClass('TestSuiteRunner', smalltalk.Object, ['suite', 'result', 'announcer', 'runNextTest'], 'SUnit');
  613. smalltalk.addMethod(
  614. "_announcer",
  615. smalltalk.method({
  616. selector: "announcer",
  617. fn: function (){
  618. var self=this;
  619. return self["@announcer"];
  620. }
  621. }),
  622. smalltalk.TestSuiteRunner);
  623. smalltalk.addMethod(
  624. "_contextOf_",
  625. smalltalk.method({
  626. selector: "contextOf:",
  627. fn: function (anInteger){
  628. var self=this;
  629. var $1;
  630. $1=smalltalk.send((smalltalk.RunningTestContext || RunningTestContext),"_testCase_result_finished_",[smalltalk.send(self["@suite"],"_at_",[anInteger]),self["@result"],(function(){
  631. return smalltalk.send(self,"_resume",[]);
  632. })]);
  633. return $1;
  634. }
  635. }),
  636. smalltalk.TestSuiteRunner);
  637. smalltalk.addMethod(
  638. "_initialize",
  639. smalltalk.method({
  640. selector: "initialize",
  641. fn: function (){
  642. var self=this;
  643. var $1;
  644. smalltalk.send(self,"_initialize",[],smalltalk.Object);
  645. self["@announcer"]=smalltalk.send((smalltalk.Announcer || Announcer),"_new",[]);
  646. self["@result"]=smalltalk.send((smalltalk.TestResult || TestResult),"_new",[]);
  647. self["@runNextTest"]=(function(){
  648. var runs;
  649. runs=smalltalk.send(self["@result"],"_runs",[]);
  650. runs;
  651. $1=smalltalk.send(runs,"__lt",[smalltalk.send(self["@result"],"_total",[])]);
  652. if(smalltalk.assert($1)){
  653. return smalltalk.send(smalltalk.send(self,"_contextOf_",[smalltalk.send(runs,"__plus",[(1)])]),"_start",[]);
  654. };
  655. });
  656. return self}
  657. }),
  658. smalltalk.TestSuiteRunner);
  659. smalltalk.addMethod(
  660. "_result",
  661. smalltalk.method({
  662. selector: "result",
  663. fn: function (){
  664. var self=this;
  665. return self["@result"];
  666. }
  667. }),
  668. smalltalk.TestSuiteRunner);
  669. smalltalk.addMethod(
  670. "_resume",
  671. smalltalk.method({
  672. selector: "resume",
  673. fn: function (){
  674. var self=this;
  675. smalltalk.send(self["@runNextTest"],"_fork",[]);
  676. smalltalk.send(self["@announcer"],"_announce_",[smalltalk.send(smalltalk.send((smalltalk.ResultAnnouncement || ResultAnnouncement),"_new",[]),"_result_",[self["@result"]])]);
  677. return self}
  678. }),
  679. smalltalk.TestSuiteRunner);
  680. smalltalk.addMethod(
  681. "_run",
  682. smalltalk.method({
  683. selector: "run",
  684. fn: function (){
  685. var self=this;
  686. smalltalk.send(self["@result"],"_total_",[smalltalk.send(self["@suite"],"_size",[])]);
  687. smalltalk.send(self,"_resume",[]);
  688. return self}
  689. }),
  690. smalltalk.TestSuiteRunner);
  691. smalltalk.addMethod(
  692. "_suite_",
  693. smalltalk.method({
  694. selector: "suite:",
  695. fn: function (aCollection){
  696. var self=this;
  697. self["@suite"]=aCollection;
  698. return self}
  699. }),
  700. smalltalk.TestSuiteRunner);
  701. smalltalk.addMethod(
  702. "_new",
  703. smalltalk.method({
  704. selector: "new",
  705. fn: function (){
  706. var self=this;
  707. smalltalk.send(self,"_shouldNotImplement",[]);
  708. return self}
  709. }),
  710. smalltalk.TestSuiteRunner.klass);
  711. smalltalk.addMethod(
  712. "_on_",
  713. smalltalk.method({
  714. selector: "on:",
  715. fn: function (aCollection){
  716. var self=this;
  717. var $1;
  718. $1=smalltalk.send(smalltalk.send(self,"_new",[],smalltalk.Object.klass),"_suite_",[aCollection]);
  719. return $1;
  720. }
  721. }),
  722. smalltalk.TestSuiteRunner.klass);