[Pharo-project] Phexample integrated with Autotest and OB (was ConfigurationOfPhexample (was #assert:equals: feels backwards))
You can now have Phexample playing nicely with OB and Autotest... * Autotest - I uploaded a new package (Autotest-Core-SeanDeNigris.5) that will pick up Phexample and any other framework that defines tests differently (it uses the class's #allTestSelectors method). * OB - I uploaded a slice to the Pharo inbox that does the same for OB (SLICE-Issue-4449-Feature-OB-can-handle-arbitrarily-defined-test-selectors-SeanDeNigris.1). All it took was removing some duplication in the system - TestCase, Autotest, and OB were all repeating the "what is a test method" logic. HTH, Sean -- View this message in context: http://forum.world.st/Phexample-integrated-with-Autotest-and-OB-was-Configur... Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
All 952 Autotest, SUnit, OB, and Phexample tests pass. -- View this message in context: http://forum.world.st/Phexample-integrated-with-Autotest-and-OB-was-Configur... Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
Too fast :) I've added some tests in Autotest-Tests-Core-LaurentLaffont.3 for Autotest-Core-LaurentLaffont.4 and one does not pass AutotestTestFinder>>testMethodsForMethodThatStartWithShouldReturnsIt | lookupMethod foundMethods thisMethod | lookupMethod := (self class>>#shouldBeFound). foundMethods := (finder methodsFor: lookupMethod). self assert: (foundMethods includes: lookupMethod). I suppose you have patched TestCase class>>allTestSelectors so it can find shouldXXX methods ? Laurent. On Fri, Jun 24, 2011 at 9:02 PM, Sean P. DeNigris <sean@clipperadams.com>wrote:
All 952 Autotest, SUnit, OB, and Phexample tests pass.
-- View this message in context: http://forum.world.st/Phexample-integrated-with-Autotest-and-OB-was-Configur... Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
laurent laffont wrote:
I suppose you have patched TestCase class>>allTestSelectors so it can find shouldXXX methods ?
Nope, although anyone wanting #shouldXxx methods in TestCase could do that. Phexample overrides #allTestSelectors to return both testXxx and shouldXxx and does the work for us. Using #allTestSelectors leaves the decision up to the library (so if people start wanting testThatItShouldXxx or whatever, it'll still work). The other advantage is that the behavior of OB, Autotest, and other testing tools will stay in sync with the behavior of the underlying SUnit system. laurent laffont wrote:
AutotestTestFinder>>testMethodsForMethodThatStartWithShouldReturnsIt
I think this behavior is now under the SUnit umbrella and doesn't have to be tested, no? Sean -- View this message in context: http://forum.world.st/Phexample-integrated-with-Autotest-and-OB-was-Configur... Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
On Fri, Jun 24, 2011 at 9:39 PM, Sean P. DeNigris <sean@clipperadams.com>wrote:
laurent laffont wrote:
I suppose you have patched TestCase class>>allTestSelectors so it can find shouldXXX methods ?
Nope, although anyone wanting #shouldXxx methods in TestCase could do that. Phexample overrides #allTestSelectors to return both testXxx and shouldXxx and does the work for us.
Using #allTestSelectors leaves the decision up to the library (so if people start wanting testThatItShouldXxx or whatever, it'll still work). The other advantage is that the behavior of OB, Autotest, and other testing tools will stay in sync with the behavior of the underlying SUnit system.
OK. I've updated ConfigurationOfAutotest. laurent laffont wrote:
AutotestTestFinder>>testMethodsForMethodThatStartWithShouldReturnsIt
I think this behavior is now under the SUnit umbrella and doesn't have to be tested, no?
Agree. Laurent
Sean
-- View this message in context: http://forum.world.st/Phexample-integrated-with-Autotest-and-OB-was-Configur... Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
Hi Sean! Phexample doesn't duplicate the logic of what is a change method, it changes it. The rational is to allow the user to choose a speaking test name, that accurately describes the test: shouldNicelyHandleNotifications And the like. Is this really in conflict with OB? Niko On 24.06.2011, at 21:01, Sean P. DeNigris wrote:
You can now have Phexample playing nicely with OB and Autotest... * Autotest - I uploaded a new package (Autotest-Core-SeanDeNigris.5) that will pick up Phexample and any other framework that defines tests differently (it uses the class's #allTestSelectors method). * OB - I uploaded a slice to the Pharo inbox that does the same for OB (SLICE-Issue-4449-Feature-OB-can-handle-arbitrarily-defined-test-selectors-SeanDeNigris.1).
All it took was removing some duplication in the system - TestCase, Autotest, and OB were all repeating the "what is a test method" logic.
HTH, Sean
-- View this message in context: http://forum.world.st/Phexample-integrated-with-Autotest-and-OB-was-Configur... Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
-- http://scg.unibe.ch/staff/Schwarz twitter.com/nes1983 Tel: +41786126354
Niko Schwarz-2 wrote:
Phexample doesn't duplicate the logic of what is a change method, it changes it. The rational is to allow the user to choose a speaking test name, that accurately describes the test:
Yes, quite nicely in fact! The issue was that the "testXxx" was hardcoded in OB and Autotest, so Phexample tests were not picked up by Autotest, and couldn't be run through OB (because "shouldXxx" was not recognized as test methods). The patch was to OB and Autotest, integrating Phexample into the tools. Sean -- View this message in context: http://forum.world.st/Phexample-integrated-with-Autotest-and-OB-was-Configur... Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
participants (3)
-
laurent laffont -
niko.schwarz@googlemail.com -
Sean P. DeNigris