From: Tamas Papp
Subject: which unit testing library?
Date: 
Message-ID: <87y7gi7f9m.fsf@pu100877.student.princeton.edu>
I would like to add serious testing (as opposed to ad-hoc test
functions) to the library I am working on.  I found many unit testing
frameworks on cliki.net, and I would appreciate some advice on which
one to choose.

My code is numerical, and I am mostly doing stuff like this: create a
random matrix, perform operations on it, check some invariant or
condition.

Thanks,

Tamas

From: Frank Buss
Subject: Re: which unit testing library?
Date: 
Message-ID: <gv4zeypkom3j$.ous7veof4aw4$.dlg@40tude.net>
Tamas Papp wrote:

> I would like to add serious testing (as opposed to ad-hoc test
> functions) to the library I am working on.  I found many unit testing
> frameworks on cliki.net, and I would appreciate some advice on which
> one to choose.

I didn't know the libraries and maybe they are better, but you could write
it in just a few lines yourself:

(defparameter *test-count* 0)
(defparameter *test-failed* 0)

(defmacro test-form (form)
  `(progn
     (incf *test-count*)
     (unless ,form
       (format t "test failed: ~s~%" (quote ,form))
       (incf *test-failed*))))

(defun test ()
  (setf *test-count* 0
        *test-failed* 0)

  (test-form (equal (* 2 3) 6))
  (test-form (equal (* 4 4) 15))
  (test-form (equal (+ 1 2) 3))

  (format t "summary: tests executed: ~a, tests failed: ~s~%"
          *test-count* *test-failed*))

CL-USER > (test)
test failed: (EQUAL (* 4 4) 15)
summary: tests executed: 3, tests failed: 1

-- 
Frank Buss, ··@frank-buss.de
http://www.frank-buss.de, http://www.it4-systems.de
From: Rainer Joswig
Subject: Re: which unit testing library?
Date: 
Message-ID: <joswig-CEA86B.13014611082007@news-europe.giganews.com>
In article <·······························@40tude.net>,
 Frank Buss <··@frank-buss.de> wrote:

> Tamas Papp wrote:
> 
> > I would like to add serious testing (as opposed to ad-hoc test
> > functions) to the library I am working on.  I found many unit testing
> > frameworks on cliki.net, and I would appreciate some advice on which
> > one to choose.
> 
> I didn't know the libraries and maybe they are better, but you could write
> it in just a few lines yourself:
> 
> (defparameter *test-count* 0)
> (defparameter *test-failed* 0)
> 
> (defmacro test-form (form)
>   `(progn
>      (incf *test-count*)
>      (unless ,form
>        (format t "test failed: ~s~%" (quote ,form))
>        (incf *test-failed*))))
> 
> (defun test ()
>   (setf *test-count* 0
>         *test-failed* 0)
> 
>   (test-form (equal (* 2 3) 6))
>   (test-form (equal (* 4 4) 15))
>   (test-form (equal (+ 1 2) 3))
> 
>   (format t "summary: tests executed: ~a, tests failed: ~s~%"
>           *test-count* *test-failed*))
> 
> CL-USER > (test)
> test failed: (EQUAL (* 4 4) 15)
> summary: tests executed: 3, tests failed: 1

Come on. He wanted 'serious testing'. Your code does not even
deal with error conditions...

Look instead here:

http://www.cs.northwestern.edu/academics/courses/325/readings/lisp-unit.html

-- 
http://lispm.dyndns.org
From: Frank Buss
Subject: Re: which unit testing library?
Date: 
Message-ID: <17dsb3ywp0c7d$.1bckrb6aynhtr.dlg@40tude.net>
Rainer Joswig wrote:

> Come on. He wanted 'serious testing'. Your code does not even
> deal with error conditions...

I translated "serious" with "regression testing", which my code does. Error
conditions could be catched and compared in a test-form, too.

> Look instead here:
> 
> http://www.cs.northwestern.edu/academics/courses/325/readings/lisp-unit.html

Thanks, this looks much better, if "serious" is translated to "full
featured library with lots of useful functions and macros" :-)

-- 
Frank Buss, ··@frank-buss.de
http://www.frank-buss.de, http://www.it4-systems.de
From: hankhero
Subject: Re: which unit testing library?
Date: 
Message-ID: <1186993633.907661.256570@o61g2000hsh.googlegroups.com>
On Aug 11, 8:32 am, Tamas Papp <······@gmail.com> wrote:
> I would like to add serious testing (as opposed to ad-hoc test
> functions) to the library I am working on.  I found many unit testing
> frameworks on cliki.net, and I would appreciate some advice on which
> one to choose.

Here is a comparision:
http://aperiodic.net/phil/archives/Geekery/notes-on-lisp-testing-frameworks.html

You should choose a Lisp framework rather that an xUnit clone. I use
FiveAM and like it a lot.
From: Tamas Papp
Subject: Re: which unit testing library?
Date: 
Message-ID: <87hcn37r3h.fsf@pu100877.student.princeton.edu>
hankhero <·············@gmail.com> writes:

> On Aug 11, 8:32 am, Tamas Papp <······@gmail.com> wrote:
>> I would like to add serious testing (as opposed to ad-hoc test
>> functions) to the library I am working on.  I found many unit testing
>> frameworks on cliki.net, and I would appreciate some advice on which
>> one to choose.
>
> Here is a comparision:
> http://aperiodic.net/phil/archives/Geekery/notes-on-lisp-testing-frameworks.html
>
> You should choose a Lisp framework rather that an xUnit clone. I use
> FiveAM and like it a lot.

Thanks for all the answers.  I think I will try lisp-unit first.

Tamas