[View]  [Edit]  [Lock]  [References]  [Attachments]  [History]  [Home]  [Changes]  [Search]  [Help] 

[m8n] Running tests

The U8 contribution load the SwikiRobot framework at startup, so it can be used to automate testing, reading the testset from s8-media swiki.
As we want to perform low-level testing, we can customize a swiki robot to evaluate the chunks containing Lua code!

To run the testset for m8n platform, evaluate the following expression in a workspace
| tester luaEval |
luaEval := [:code| | source |
	source := code trimBlanks.
	(source startsWith: #--) ifTrue: [ "Lua source code"
		[ #{fengari} #load: source ] on: Error do: [:err|
			self alert: err.
			tester abortPage
	] ifFalse: [ "assume it is smalltalk code"
		source stream fileIn
tester := SwikiCodeRobot @ #test.
	when: #evaluate: do: luaEval;
	process: #s8-media tagged: #m8n

Uploaded Image: alert.gifNote that the output of the tests will be sent to Transcript, so if you have not opened the Transcript tool, you can press the [U8] icon in the toolbar (bottom/right U8 icon) to see the last output sent to Transcript