Re: Unit testing

"H. William Welliver III" <[email protected]>
Newsgroups gmane.comp.lang.pike.user
Message-ID <[email protected]>
I’m not aware of any well-developed unit test library other than test suite.

The test suite stuff makes sense if you’re an m4 kind of person, but it is, as you point out, very different from what most people are accustomed to. The nice part of test suite is that it comes with every pike install (the document you point to is a little outdated with respect to actually running the tests: you’d use pike -x test_pike nowadays. It [testsuite] also lends itself to integration with Make based build systems. 

If that’s not your thing, you could probably throw something together pretty quickly. A while back there was some discussion of assertions that you could probably use during unit testing. A simple script that looped through files in a tests directory would give you pretty easy “one test per file”. The FSEvents module has a set of subtests that are run from within a pike file, which gets you around having to write tests in m4.

Hope this helps!

Bill

On Oct 1, 2014, at 12:40 PM, Tor Edvardsson @ Pike importmöte för mailinglistan <[email protected]> wrote:

> Hi all,
> 
> Does it exist an unit test library for pike other than testsuite? 
> 
> http://wiki.gotpike.org/PikeDevel/Writing%20Testsuites
> 
> I have used it before and looked at it again, however it feels a bit wonky. You write in some macro language first and then run a script to generate the testsuite to something pikeish and then run that in pike.
> 
> I'm missing how other unit test library does stuff in other languages. Any recommendations? Or have I just missunderstood the greatness of testsuite?
> 
> Tor Edvardsson
> [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.