Marcel Taeumel uploaded a new version of SUnitGUI to project The Trunk:
http://source.squeak.org/trunk/SUnitGUI-mt.71.mcz ==================== Summary ==================== Name: SUnitGUI-mt.71 Author: mt Time: 14 August 2019, 4:55:53.613512 pm UUID: 566c13a6-5e67-1c4d-9087-942122f28586 Ancestors: SUnitGUI-mt.70, SUnitGUI-ct.70 Merges SUnitGUI-ct.70. Adds a convenient way to open a test runner with tests for a particular suite pre-selected. Try: TestRunner openForSuite: CollectionTest buildSuite. =============== Diff against SUnitGUI-mt.70 =============== Item was added: + ----- Method: TestRunner class>>buildForSuite: (in category 'instance-creation') ----- + buildForSuite: aTestSuite + ^ ToolBuilder build: (self newForSuite: aTestSuite).! Item was added: + ----- Method: TestRunner class>>newForSuite: (in category 'instance-creation') ----- + newForSuite: aSuite + + | runner classes categories | + runner := TestRunner new. + classes := aSuite tests asSet collect: #class. + categories := classes collect: #category. + ^ runner + filterCategoriesBy: ((categories collect: #asString) asArray joinSeparatedBy: $;); + filterClassesBy: ((classes collect: #asString) asArray joinSeparatedBy: $;); + yourself! Item was added: + ----- Method: TestRunner class>>openForSuite: (in category 'instance-creation') ----- + openForSuite: aTestSuite + ^ ToolBuilder open: (self newForSuite: aTestSuite).! Item was changed: ----- Method: TestRunner>>filterCategories (in category 'accessing-categories') ----- filterCategories | pattern | pattern := UIManager default request: 'Pattern(s) to select categories:\ (separate patterns with '';'')' withCRs initialAnswer: (categoryPattern ifNil: ['*']). (pattern isNil or: [pattern isEmpty]) ifTrue: [^self]. + self filterCategoriesBy: pattern! - categoriesSelected := ((categoryPattern := pattern) subStrings: ';') - inject: Set new - into: [:matches :subPattern| - matches - addAll: (categories select: [ :each | subPattern match: each]); - yourself]. - self changed: #allSelections; changed: #categorySelected; updateClasses! Item was added: + ----- Method: TestRunner>>filterCategoriesBy: (in category 'accessing-categories') ----- + filterCategoriesBy: aPattern + categoriesSelected := ((categoryPattern := aPattern) subStrings: ';') + inject: Set new + into: [:matches :subPattern| + matches + addAll: (categories select: [ :each | subPattern match: each]); + yourself]. + self changed: #allSelections; changed: #categorySelected; updateClasses! Item was changed: ----- Method: TestRunner>>filterClasses (in category 'accessing-classes') ----- filterClasses | pattern | pattern := UIManager default request: 'Pattern(s) to select tests:\ (separate patterns with '';'')' withCRs initialAnswer: (classPattern ifNil: '*'). (pattern isNil or: [pattern isEmpty]) ifTrue: [^self]. + self filterClassesBy: pattern! - classesSelected := ((classPattern := pattern) subStrings: ';') - inject: Set new - into: [:matches :subPattern| - matches - addAll: (classes select: [ :each | subPattern match: each name]); - yourself]. - self - changed: #allSelections; - changed: #classSelected; - changed: #hasRunnable! Item was added: + ----- Method: TestRunner>>filterClassesBy: (in category 'accessing-classes') ----- + filterClassesBy: aPattern + classesSelected := ((classPattern := aPattern) subStrings: ';') + inject: Set new + into: [:matches :subPattern| + matches + addAll: (classes select: [ :each | subPattern match: each name]); + yourself]. + self + changed: #allSelections; + changed: #classSelected; + changed: #hasRunnable! |
Free forum by Nabble | Edit this page |