[squeak-dev] The Trunk: ToolsTests-mt.112.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Jun 13 07:48:15 UTC 2022


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

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

Name: ToolsTests-mt.112
Author: mt
Time: 13 June 2022, 9:48:14.968751 am
UUID: 3acef730-603f-2a4a-ac18-542c83ed393e
Ancestors: ToolsTests-jar.111, ToolsTests-jar.109

Merge ToolsTests-jar.109.

Modified tests to reflect the change in the default "close" debugger action to #terminateAggresively introduced in Kernel-ct.1434 (ct) [...]

=============== Diff against ToolsTests-ct.109 ===============

Item was changed:
  ----- Method: DebuggerTests>>test19Abandon (in category 'tests') -----
  test19Abandon
  	"When the debugger is abandoned, the interrupted process is terminated aggressively, i.e., all not yet started unwind contexts are executed. Further errors that occur during unwinding lead to another debugger showing up. This is the acceptance test equivalent for ProcessTest >> #testTerminateNestedUnwindAggressively."
  
  	| x y z userProcess |
  	process := Process
  		forBlock:
+ 			[[x := 1] ensure: 
+ 				[[y := 1.
+ 				self error: #first.
+ 				y := 2] ensure:
+ 					[z := 1.
+ 					self error: #second.
+ 					z := 2]].
- 			[x := 1.
- 			[y := 1.
- 			self error: #first.
- 			y := 2] ensure:
- 				[z := 1.
- 				self error: #second.
- 				z := 2].
  			x := 2]
  		runUntil: [:ctx | y = 1].
  	self should: {x. y. z} = {1. 1. nil}.
  	debugger := process debug.
  	
  	userProcess := [debugger proceed] forkAt: Processor activePriority + 1.
  	Processor yield.
  	self findDebugger.
  	
  	self deny: process isTerminated.
  	self assert: userProcess isTerminated.
  	self deny: debugger isNil.
  	self assert: {1. 1. nil} equals: {x. y. z}.
  	self assert: (debugger containingWindow label includesSubstring: #first).
  	
  	userProcess := [debugger abandon] forkAt: Processor activePriority + 1.
  	Processor yield.
  	self findDebugger.
  	
  	self deny: process isTerminated.
  	self assert: userProcess isTerminated.
  	self deny: debugger isNil.
  	self assert: {1. 1. 1} equals: {x. y. z}.
  	self assert: (debugger containingWindow label includesSubstring: #second).
  	
  	userProcess := [debugger proceed] forkAt: Processor activePriority + 1.
  	Processor yield.
  	self findDebugger.
  	
  	self assert: process isTerminated.
  	self assert: userProcess isTerminated.
  	self assert: debugger isNil.
  	self assert: {1. 1. 2} equals: {x. y. z}.!

Item was changed:
  ----- Method: DebuggerTests>>test20TerminateProcess (in category 'tests') -----
  test20TerminateProcess
  	"When the debugger's process is terminated, all unwind contexts, including already entered ones, are executed. Further errors that occur during unwinding lead to another debugger showing up. This is the acceptance test equivalent for ProcessTest >> #testTerminateNestedUnwind."
  
  	| x y z userProcess |
  	process := Process
  		forBlock:
+ 			[[x := 1] ensure: 
+ 				[[y := 1.
+ 				self error: #first.
+ 				y := 2] ensure:
+ 					[z := 1.
+ 					self error: #second.
+ 					z := 2]].
- 			[x := 1.
- 			[y := 1.
- 			self error: #first.
- 			y := 2] ensure:
- 				[z := 1.
- 				self error: #second.
- 				z := 2].
  			x := 2]
  		runUntil: [:ctx | y = 1].
  	self should: {x. y. z} = {1. 1. nil}.
  	debugger := process debug.
  	
  	userProcess := [debugger proceed] forkAt: Processor activePriority + 1.
  	Processor yield.
  	self findDebugger.
  	
  	self deny: process isTerminated.
  	self assert: userProcess isTerminated.
  	self deny: debugger isNil.
  	self assert: {1. 1. nil} equals: {x. y. z}.
  	self assert: (debugger containingWindow label includesSubstring: #first).
  	
  	userProcess := [debugger terminateProcess] forkAt: Processor activePriority + 1.
  	Processor yield.
  	self findDebugger.
  	
  	self deny: process isTerminated.
  	self assert: userProcess isTerminated.
  	self deny: debugger isNil.
  	self assert: {1. 2. 1} equals: {x. y. z}.
  	self assert: (debugger containingWindow label includesSubstring: #second).
  	
  	userProcess := [debugger proceed] forkAt: Processor activePriority + 1.
  	Processor yield.
  	self findDebugger.
  	
  	self assert: process isTerminated.
  	self assert: userProcess isTerminated.
  	self assert: debugger isNil.
+ 	self assert: {1. 2. 2} equals: {x. y. z}.!
- 	self assert: {2. 2. 2} equals: {x. y. z}.!

Item was added:
+ ----- Method: DebuggerTests>>test21TerminateErrorInEnsureBlock (in category 'tests') -----
+ test21TerminateErrorInEnsureBlock
+ 	"Closing a debugger on a suspended process means terminating that process."
+ 	
+ 	| x1 x2 x3 x4 |
+ 	x1 := x2 := x3 := x4 := false.
+ 	process := 
+ 		[ 
+ 			[
+ 				[ ] ensure: [
+ 					[self error: 'outer error'] ensure: [
+ 						x1 := true]. 
+ 					x2 := true]
+ 			] ensure: [
+ 				x3 := true].
+ 			x4 := true	
+ 		] fork.
+ 	Processor yield.
+ 
+ 	"make sure process is suspended and none of the unwind blocks has finished yet"
+ 	self assert: process isSuspended.
+ 	self deny: x1 | x2 | x3 | x4.
+ 
+ 	"now find and close the debugger and make sure all unwind blocks have finished"
+ 	self ensureDebugger.
+ 	debugger terminateProcess.
+ 	
+ 	self assert: process isTerminated.
+ 	self assert: x1 & x2 & x3.
+ 	self deny: x4!

Item was added:
+ ----- Method: DebuggerTests>>test22TerminateErrorInNestedEnsureBlock (in category 'tests') -----
+ test22TerminateErrorInNestedEnsureBlock
+ 	"Closing a debugger on a suspended process means terminating that process."
+ 	
+ 	| x1 x2 x3 x4 |
+ 	x1 := x2 := x3 := x4 := false.
+ 	process := 
+ 		[ 
+ 			[
+ 				[ ] ensure: [
+ 					[] ensure: [
+ 						self error: 'inner error'.
+ 						x1 := true]. 
+ 					x2 := true]
+ 			] ensure: [
+ 				x3 := true].
+ 			x4 := true	
+ 		] fork. 
+ 	Processor yield.
+ 
+ 	"make sure process is suspended and none of the unwind blocks has finished yet"
+ 	self assert: process isSuspended.
+ 	self deny: x1 | x2 | x3 | x4.
+ 
+ 	"now find and close the debugger and make sure all unwind blocks have finished"
+ 	self ensureDebugger.
+ 	debugger terminateProcess.
+ 	
+ 	self assert: process isTerminated.
+ 	self assert: x1 & x2 & x3.
+ 	self deny: x4!

Item was added:
+ ----- Method: DebuggerTests>>test23TerminateDoubleErrorInEnsure (in category 'tests') -----
+ test23TerminateDoubleErrorInEnsure
+ 	"Closing a debugger on a suspended process means terminating that process."
+ 	
+ 	| x1 x2 x3 x4 |
+ 	x1 := x2 := x3 := x4 := false.
+ 	process := 
+ 		[ 
+ 			[
+ 				[ ] ensure: [
+ 					[self error: 'outer error'] ensure: [
+ 						self error: 'inner error'.
+ 						x1 := true]. 
+ 					x2 := true]
+ 			] ensure: [
+ 				x3 := true].
+ 			x4 := true	
+ 		] fork. 
+ 	Processor yield.
+ 
+ 	"make sure process is suspended and none of the unwind blocks has finished yet"
+ 	self assert: process isSuspended.
+ 	self deny: x1 | x2 | x3 | x4.
+ 
+ 	"now find and close the debugger and let the unwind continue to the next error"
+ 	self ensureDebugger.
+ 	process := [debugger terminateProcess] fork. 
+ 	Processor yield.
+ 	
+ 	"make sure process is suspended and none of the unwind blocks has finished yet"
+ 	self assert: process isSuspended.
+ 	self deny: x1 | x2 | x3 | x4.
+ 
+ 	"now find and close the debugger and make sure all unwind blocks have finished"
+ 	self ensureDebugger.
+ 	debugger terminateProcess.
+ 	
+ 	self assert: process isTerminated.
+ 	self assert: x1 & x2 & x3.
+ 	self deny: x4!

Item was added:
+ ----- Method: DebuggerTests>>test24TerminateTripleErrorInEnsure (in category 'tests') -----
+ test24TerminateTripleErrorInEnsure
+ 	"Closing a debugger on a suspended process means terminating that process."
+ 	
+ 	| x1 x2 x3 x4 |
+ 	x1 := x2 := x3 := x4 := false.
+ 	process := 
+ 		[ 
+ 			[
+ 				[self error: 'outer error'] ensure: [
+ 					[self error: 'middle error'] ensure: [
+ 						self error: 'inner error'.
+ 						x1 := true]. 
+ 					x2 := true]
+ 			] ensure: [
+ 				x3 := true].
+ 			x4 := true	
+ 		] fork.
+ 	Processor yield.
+ 
+ 	"make sure process is suspended and none of the unwind blocks has finished yet"
+ 	self assert: process isSuspended.
+ 	self deny: x1 | x2 | x3 | x4.
+ 
+ 	"now find and close the debugger and let the unwind continue to the next error"
+ 	self ensureDebugger.
+ 	process := [debugger terminateProcess] fork. 
+ 	Processor yield.
+ 
+ 	"make sure process is suspended and none of the unwind blocks has finished yet"
+ 	self assert: process isSuspended.
+ 	self deny: x1 | x2 | x3 | x4.
+ 
+ 	"now find and close the debugger and let the unwind continue to the next error"
+ 	self ensureDebugger.
+ 	process := [debugger terminateProcess] fork. 
+ 	Processor yield.
+ 
+ 	"make sure process is suspended and none of the unwind blocks has finished yet"
+ 	self assert: process isSuspended.
+ 	self deny: x1 | x2 | x3 | x4.
+ 
+ 	"now find and close the debugger and make sure all unwind blocks have finished"
+ 	self ensureDebugger.
+ 	debugger terminateProcess.
+ 	
+ 	self assert: process isTerminated.
+ 	self assert: x1 & x2 & x3.
+ 	self deny: x4!



More information about the Squeak-dev mailing list