Helios-Commands-SUnit.st 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. Smalltalk createPackage: 'Helios-Commands-SUnit'!
  2. HLToolCommand subclass: #HLSUnitCommand
  3. instanceVariableNames: ''
  4. package: 'Helios-Commands-SUnit'!
  5. !HLSUnitCommand commentStamp!
  6. I group the commands pertaining to Helios-SUnit (`HLSUnitModel`)!
  7. !HLSUnitCommand class methodsFor: 'testing'!
  8. isValidFor: aModel
  9. ^ aModel isKindOf: HLSUnitModel
  10. ! !
  11. HLSUnitCommand subclass: #HLSUnitInvertSelectedCommand
  12. instanceVariableNames: ''
  13. package: 'Helios-Commands-SUnit'!
  14. !HLSUnitInvertSelectedCommand commentStamp!
  15. I group the commands that invert selections!
  16. !HLSUnitInvertSelectedCommand class methodsFor: 'accessing'!
  17. key
  18. ^ 'i'
  19. !
  20. label
  21. ^'Invert selection'
  22. ! !
  23. HLSUnitInvertSelectedCommand subclass: #HLSUnitInvertSelectedClassesCommand
  24. instanceVariableNames: ''
  25. package: 'Helios-Commands-SUnit'!
  26. !HLSUnitInvertSelectedClassesCommand commentStamp!
  27. Invert the currently selected classes on a `HLSUnitModel`!
  28. !HLSUnitInvertSelectedClassesCommand methodsFor: 'accessing'!
  29. category
  30. ^'Classes'
  31. ! !
  32. !HLSUnitInvertSelectedClassesCommand methodsFor: 'executing'!
  33. execute
  34. self model invertSelectedClasses
  35. ! !
  36. !HLSUnitInvertSelectedClassesCommand methodsFor: 'testing'!
  37. isActive
  38. ^model selectedPackages notEmpty
  39. ! !
  40. !HLSUnitInvertSelectedClassesCommand class methodsFor: 'accessing'!
  41. key
  42. ^ 'c'
  43. !
  44. label
  45. ^ 'Invert selected classes'
  46. ! !
  47. HLSUnitInvertSelectedCommand subclass: #HLSUnitInvertSelectedPackagesCommand
  48. instanceVariableNames: ''
  49. package: 'Helios-Commands-SUnit'!
  50. !HLSUnitInvertSelectedPackagesCommand commentStamp!
  51. Invert the currently selected packages on a `HLSUnitModel`!
  52. !HLSUnitInvertSelectedPackagesCommand methodsFor: 'accessing'!
  53. category
  54. ^'Packages'
  55. ! !
  56. !HLSUnitInvertSelectedPackagesCommand methodsFor: 'executing'!
  57. execute
  58. self model invertSelectedPackages
  59. ! !
  60. !HLSUnitInvertSelectedPackagesCommand methodsFor: 'testing'!
  61. isActive
  62. ^true
  63. ! !
  64. !HLSUnitInvertSelectedPackagesCommand class methodsFor: 'accessing'!
  65. key
  66. ^ 'p'
  67. !
  68. label
  69. ^ 'Invert selected packages'
  70. ! !
  71. HLSUnitCommand subclass: #HLSUnitRunTests
  72. instanceVariableNames: ''
  73. package: 'Helios-Commands-SUnit'!
  74. !HLSUnitRunTests commentStamp!
  75. Run the test cases in the currently selected classes on a `HLSUnitModel`!
  76. !HLSUnitRunTests methodsFor: 'executing'!
  77. execute
  78. self model runTests
  79. ! !
  80. !HLSUnitRunTests methodsFor: 'testing'!
  81. isActive
  82. ^true
  83. ! !
  84. !HLSUnitRunTests class methodsFor: 'accessing'!
  85. key
  86. ^'r'
  87. !
  88. label
  89. ^'Run Tests'
  90. ! !
  91. HLSUnitCommand subclass: #HLSUnitSelectAllCommand
  92. instanceVariableNames: ''
  93. package: 'Helios-Commands-SUnit'!
  94. !HLSUnitSelectAllCommand commentStamp!
  95. I group the select all commands!
  96. !HLSUnitSelectAllCommand class methodsFor: 'accessing'!
  97. key
  98. ^ 'a'
  99. !
  100. label
  101. ^ 'Select all'
  102. ! !
  103. HLSUnitSelectAllCommand subclass: #HLSUnitSelectAllClassesCommand
  104. instanceVariableNames: ''
  105. package: 'Helios-Commands-SUnit'!
  106. !HLSUnitSelectAllClassesCommand commentStamp!
  107. Select all available test classes based on what packages are selected on a `HLSUnitModel`!
  108. !HLSUnitSelectAllClassesCommand methodsFor: 'accessing'!
  109. category
  110. ^'Classes'
  111. ! !
  112. !HLSUnitSelectAllClassesCommand methodsFor: 'executing'!
  113. execute
  114. self model selectAllClasses
  115. ! !
  116. !HLSUnitSelectAllClassesCommand methodsFor: 'testing'!
  117. isActive
  118. ^model selectedPackages notEmpty
  119. ! !
  120. !HLSUnitSelectAllClassesCommand class methodsFor: 'accessing'!
  121. key
  122. ^ 'c'
  123. !
  124. label
  125. ^ 'Select all classes'
  126. ! !
  127. HLSUnitSelectAllCommand subclass: #HLSUnitSelectAllPackagesCommand
  128. instanceVariableNames: ''
  129. package: 'Helios-Commands-SUnit'!
  130. !HLSUnitSelectAllPackagesCommand commentStamp!
  131. Select all packages with test cases on a `HLSUnitModel`!
  132. !HLSUnitSelectAllPackagesCommand methodsFor: 'accessing'!
  133. category
  134. ^'Packages'
  135. ! !
  136. !HLSUnitSelectAllPackagesCommand methodsFor: 'executing'!
  137. execute
  138. self model selectAllPackages
  139. ! !
  140. !HLSUnitSelectAllPackagesCommand methodsFor: 'testing'!
  141. isActive
  142. ^true
  143. ! !
  144. !HLSUnitSelectAllPackagesCommand class methodsFor: 'accessing'!
  145. key
  146. ^ 'p'
  147. !
  148. label
  149. ^ 'Select all packages'
  150. ! !