Displaying SUnit tests/results in a Seaside App.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Displaying SUnit tests/results in a Seaside App.

Squeak - Dev mailing list
Hi Folks,

I am writing a ton of tests for my parser grammar, and since the test results are xHTML, I thought it would be useful to display the tests and the output in a Seaside app.

I searched the Seaside forum for this and did not see anything, so I am posting this here as it might be a useful tool for Squeak/Pharo in general (someday)


I doubt it is doable, but here goes:

Here is a test from my current work:

testLinkExternal

<timeout: 10>
"LinkExternal <- OPEN_BRACKET  s URLPrefix .{SpaceCaption} "

|input xmlElement actor ios|

actor := PEGWikiMediaGeneratorTables new.
actor transcripton: false.
      input := '[http://www.wikipedia.org Named]'.  
xmlElement := parser parse: 'LinkExternal' stream: input reading actor: actor.
ios := xmlElement printString.
self assert: ((ios contents) = '<a href="http://www.wikipedia.org">Named</a>') .

      input := '[https://www.wikipedia.org  DUDE]'.  
xmlElement := parser parse: 'LinkExternal' stream: input reading actor: actor.
ios := xmlElement printString.
self assert: ((ios contents) = '<a href="https://www.wikipedia.org">DUDE</a>') .

      input := '[mailto:[hidden email]]'.  
xmlElement := parser parse: 'LinkExternal' stream: input reading actor: actor.
ios := xmlElement printString.
self assert: ((ios contents) = '<a href="mailto:[hidden email]">mailto:[hidden email]</a>') .

      input := '[irc://something]'.  
xmlElement := parser parse: 'LinkExternal' stream: input reading actor: actor.
ios := xmlElement printString.
self assert: ((ios contents) = '<a href="irc://something">irc://something</a>') .

      input := '[ircs://something]'.  
xmlElement := parser parse: 'LinkExternal' stream: input reading actor: actor.
ios := xmlElement printString.
self assert: ((ios contents) = '<a href="ircs://something">ircs://something</a>') .

      input := '[ftp://something.org]'.  
xmlElement := parser parse: 'LinkExternal' stream: input reading actor: actor.
ios := xmlElement printString.
self assert: ((ios contents) = '<a href="ftp://something.org">ftp://something.org</a>') .

      input := '[news://emacs.org]'.  
xmlElement := parser parse: 'LinkExternal' stream: input reading actor: actor.
ios := xmlElement printString.
self assert: ((ios contents) = '<a href="news://emacs.org">news://emacs.org</a>') .

      input := '[gopher://what.is.a.gopher.address]'.  
xmlElement := parser parse: 'LinkExternal' stream: input reading actor: actor.
ios := xmlElement printString.
self assert: ((ios contents) = '<a href="gopher://what.is.a.gopher.address">gopher://what.is.a.gopher.address</a>') .

Thinking out loud, I would like to see the test name, its status, upon clicking it, the value of "input" and "ios contents" displayed on the web page.

Pretty weird, huh?

Feel free to shoot-it-down if it is ugly. (:

cheers