[squeak-dev] The Trunk: TraitsTests-mt.24.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Sep 3 06:32:10 UTC 2019


Marcel Taeumel uploaded a new version of TraitsTests to project The Trunk:
http://source.squeak.org/trunk/TraitsTests-mt.24.mcz

==================== Summary ====================

Name: TraitsTests-mt.24
Author: mt
Time: 3 September 2019, 8:32:08.723063 am
UUID: 1a70eef8-61da-cb49-b67e-edb7358f5383
Ancestors: TraitsTests-mt.23

Speeds up tests a little bit more.

Test resources are usually only set up once before all tests. Cache source files then, too.

(Except for some traits tests which make the resource dirty. See TraitsResource class >> #resetIfDirty.)

=============== Diff against TraitsTests-mt.23 ===============

Item was changed:
  ----- Method: TraitsResource>>setUp (in category 'running') -----
  setUp
- 	"Please note, that most tests rely on this setup of traits and
- 	classes - and that especially the order of the definitions matters."
- 	"SetUpCount := SetUpCount + 1."
  
+ 	super setUp.
+ 	
  	dirty := false.
+ 
+ 	CurrentReadOnlySourceFiles cacheDuring: [
+ 		SystemChangeNotifier uniqueInstance doSilently: [
+ 			Utilities useAuthorInitials: self className during: [
+ 				self setUpSilently]]].!
- 	Utilities
- 		useAuthorInitials: self className
- 		during: [
- 			SystemChangeNotifier uniqueInstance doSilently: [
- 				self t1: (self createTraitNamed: #T1 uses: { }).
- 				self t1 comment: 'I am the trait T1'.
- 				self t2: (self createTraitNamed: #T2 uses: { }).
- 				self t2 compile: 'm21 ^21' classified: #cat1.
- 				self t2 compile: 'm22 ^22' classified: #cat2.
- 				self t2 classSide compile: 'm2ClassSide: a ^a'.
- 				self t3: (self createTraitNamed: #T3 uses: { }).
- 				self t3 compile: 'm31 ^31' classified: #cat1.
- 				self t3 compile: 'm32 ^32' classified: #cat2.
- 				self t3 compile: 'm33 ^33' classified: #cat3.
- 				self t4: (self createTraitNamed: #T4 uses: { (self t1). (self t2) }).
- 				self t4 compile: 'm11 ^41' classified: #catX.	"overrides T1>>m11"
- 				self t4 compile: 'm42 ^42' classified: #cat2.
- 				self t5: (self createTraitNamed: #T5 uses: self t1 + self t2).
- 				self t5 compile: 'm51 ^super foo' classified: #cat1.
- 				self t5 compile: 'm52 ^ self class bar' classified: #cat1.
- 				self t5 compile: 'm53 ^ self class bar' classified: #cat1.
- 				self t6: (self
- 					createTraitNamed: #T6
- 					uses: (self t1 + (self t2 @ { (#m22Alias -> #m22) }))).
- 				self c1: (
- 					self 
- 						createClassNamed: #C1
- 						superclass: Object
- 						uses: { }).
- 				self c1 compile: 'foo ^true' classified: #accessing.
- 				self t1 compile: 'm11 ^11' classified: #cat1.
- 				self t1 compile: 'm12 ^12' classified: #cat2.
- 				self t1 compile: 'm13 ^self m12' classified: #cat3.
- 				self c2: (self 
- 							createClassNamed: #C2
- 							superclass: self c1
- 							uses: self t5 - { #m11 }).
- 				self c2 compile: 'foo ^false' classified: #private.
- 				self c2 compile: 'bar ^self foo' classified: #private.
- 				self setUpTrivialRequiresFixture.
- 				self setUpTwoLevelRequiresFixture.
- 				self setUpTranslatingRequiresFixture ] ].
- 	SystemChangeNotifier uniqueInstance notify: self ofAllSystemChangesUsing: #codeChangedEvent:!

Item was added:
+ ----- Method: TraitsResource>>setUpSilently (in category 'running') -----
+ setUpSilently
+ 	"Please note, that most tests rely on this setup of traits and
+ 	classes - and that especially the order of the definitions matters."
+ 	"SetUpCount := SetUpCount + 1."
+ 
+ 	self t1: (self createTraitNamed: #T1 uses: { }).
+ 	self t1 comment: 'I am the trait T1'.
+ 	self t2: (self createTraitNamed: #T2 uses: { }).
+ 	self t2 compile: 'm21 ^21' classified: #cat1.
+ 	self t2 compile: 'm22 ^22' classified: #cat2.
+ 	self t2 classSide compile: 'm2ClassSide: a ^a'.
+ 	self t3: (self createTraitNamed: #T3 uses: { }).
+ 	self t3 compile: 'm31 ^31' classified: #cat1.
+ 	self t3 compile: 'm32 ^32' classified: #cat2.
+ 	self t3 compile: 'm33 ^33' classified: #cat3.
+ 	self t4: (self createTraitNamed: #T4 uses: { (self t1). (self t2) }).
+ 	self t4 compile: 'm11 ^41' classified: #catX.	"overrides T1>>m11"
+ 	self t4 compile: 'm42 ^42' classified: #cat2.
+ 	self t5: (self createTraitNamed: #T5 uses: self t1 + self t2).
+ 	self t5 compile: 'm51 ^super foo' classified: #cat1.
+ 	self t5 compile: 'm52 ^ self class bar' classified: #cat1.
+ 	self t5 compile: 'm53 ^ self class bar' classified: #cat1.
+ 	self t6: (self
+ 		createTraitNamed: #T6
+ 		uses: (self t1 + (self t2 @ { (#m22Alias -> #m22) }))).
+ 	self c1: (
+ 		self 
+ 			createClassNamed: #C1
+ 			superclass: Object
+ 			uses: { }).
+ 	self c1 compile: 'foo ^true' classified: #accessing.
+ 	self t1 compile: 'm11 ^11' classified: #cat1.
+ 	self t1 compile: 'm12 ^12' classified: #cat2.
+ 	self t1 compile: 'm13 ^self m12' classified: #cat3.
+ 	self c2: (self 
+ 				createClassNamed: #C2
+ 				superclass: self c1
+ 				uses: self t5 - { #m11 }).
+ 	self c2 compile: 'foo ^false' classified: #private.
+ 	self c2 compile: 'bar ^self foo' classified: #private.
+ 	
+ 	self setUpTrivialRequiresFixture.
+ 	self setUpTwoLevelRequiresFixture.
+ 	self setUpTranslatingRequiresFixture.
+ 		
+ 	SystemChangeNotifier uniqueInstance notify: self ofAllSystemChangesUsing: #codeChangedEvent:!

Item was changed:
  ----- Method: TraitsResource>>tearDown (in category 'running') -----
  tearDown
  	
+ 	CurrentReadOnlySourceFiles cacheDuring: [
+ 		SystemChangeNotifier uniqueInstance doSilently: [
+ 			Utilities useAuthorInitials: self className during: [
+ 				self tearDownSilently]]].
- 	SystemChangeNotifier uniqueInstance noMoreNotificationsFor: self.
  	
+ 	super tearDown.!
- 	SystemChangeNotifier uniqueInstance doSilently: [
- 		self createdClassesAndTraits do: 
- 				[:aClassOrTrait | | behaviorName | 
- 				behaviorName := aClassOrTrait name.
- 				Smalltalk at: behaviorName
- 					ifPresent: [:classOrTrait | classOrTrait removeFromSystem].
- 				ChangeSet current removeClassChanges: behaviorName] ].
- 		
- 	createdClassesAndTraits := self t1: (self 
- 						t2: (self t3: (self 
- 										t4: (self t5: (self 
- 														t6: (self c1: (self 
- 																		c2: (self c3: (self c4: (self c5: (self c6: (self c7: (self c8: nil)))))))))))))!

Item was added:
+ ----- Method: TraitsResource>>tearDownSilently (in category 'running') -----
+ tearDownSilently
+ 	
+ 	SystemChangeNotifier uniqueInstance noMoreNotificationsFor: self.
+ 	
+ 	self createdClassesAndTraits do: 
+ 			[:aClassOrTrait | | behaviorName | 
+ 			behaviorName := aClassOrTrait name.
+ 			Smalltalk at: behaviorName
+ 				ifPresent: [:classOrTrait | classOrTrait removeFromSystem].
+ 			ChangeSet current removeClassChanges: behaviorName].
+ 		
+ 	createdClassesAndTraits := self t1: (self 
+ 						t2: (self t3: (self 
+ 										t4: (self t5: (self 
+ 														t6: (self c1: (self 
+ 																		c2: (self c3: (self c4: (self c5: (self c6: (self c7: (self c8: nil)))))))))))))!



More information about the Squeak-dev mailing list