<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Necto,<div><br></div><div>There isn't a super beautiful way to do this in LIFT (at least, not that I've come up with!).</div><div><br></div><div>Two things come to mind:</div><div><br></div><div>1. make a test-suite like</div><div><br></div><div>(deftestsuite percl-db-test (percl-test)</div><div><span class="Apple-tab-span" style="white-space:pre">   </span>(db-class *db*)</div><div>  (:setup </div><div>  (setf *db* (make-instance db-class)))<br><br>(addtest (percl-db-test) store ...)<br>(addtest (percl-db-test) load ...)<br></div><div><br></div><div>then make a new test suite</div><div><br></div><div>(deftestsuite percl-db-test-runner (percl-test)</div><div>  ())</div><div><br></div><div>(addtest (percl-db-test-runner)</div><div>  test-mem-db </div><div>  (let ((*test-result* (run-tests :suite 'percl-db-test :testsuite-initargs '(:db-class 'mem-db))</div><div>   -- make sure there were no failures and errors --</div><div>   ))</div><div><br></div><div>There are examples like this in the LIFT test-suite</div><div><br></div><div>2. use ensure-cases</div><div><br></div><div>(deftestsuite percl-db-test (percl-test)<br>  ())</div><div><br>(addtest (percl-db-test) store  </div><div>    (ensure-cases (class) </div><div>     '(mem-db sql-db)</div><div>    (let ((*db* (make-instance class))) ...))</div><div><br></div><div>Using a macro to handle the boilerplate for the second idea will make it look fairly elegant :-)</div><div><br></div><div><br></div><div>HTH,</div><div><br></div><div><br></div><div>On Mar 18, 2012, at 8:22 AM, necto wrote:</div><div><div><br class="Apple-interchange-newline"><blockquote type="cite">Hello, everyone!<br><br>I need the following thing:<br>I had a test-suite setted up for some value (class-instance). Now there are anothe value with the same properties, and I want it to be tested in the same test-suite. Workaround looks very ugly:<br>
<br>(deftestsuite percl-db-test (percl-test)<br>  ((*db* (make-instance '<span style="color:rgb(255,0,0)">tst-mem-db</span>)))<br><br>(addtest (percl-db-test) store ...)<br>
(addtest (percl-db-test) load ...)<br><br>;.....<br><br>(deftestsuite percl-db-test (percl-test)<br>  ((*db* (make-instance <span style="color:rgb(255,0,0)">'tst-sql-db</span>)))<br><br>(addtest (percl-db-test) store ...)<br>

(addtest (percl-db-test) load ...)<br><br>Is there any way to do it smart?<br><br>Regards,<br> Necto.<br>
_______________________________________________<br>lift-devel mailing list<br><a href="mailto:lift-devel@common-lisp.net">lift-devel@common-lisp.net</a><br>http://lists.common-lisp.net/cgi-bin/mailman/listinfo/lift-devel<br></blockquote></div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>--</div><div>Gary Warren King, <a href="http://metabang.com/">metabang.com</a> <br>Cell: (413) 559 8738<br>Fax: (206) 338-4052<br>gwkkwg on Skype * garethsan on AIM * gwking on twitter<br></div></div></span></div></span></span>
</div>
<br></div></body></html>