Skip to content

marchildmann/newlisp-unittest

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

nl-unittest is a simple unit testing framework for newLISP [1], a modern dialect of Lisp [2].

Installing

Just load the file: nl-unittest.lsp in the main directory.

Optional Parameters

  • UnitTest:*verbose*

    true if you want to output the whole assert expression, and nil if you want the output to be of the form => Expected: <some-value> -> Received: <some-value>. Default value: nil.

  • UnitTest:*continue-after-failure*

    true if you want to continue testing whatever the previous test case result is, and nil otherwise. Default value: true.

  • UnitTest:*enable-term-color*

    true if you want to have colors in VT-100 compatible terminal, and nil otherwise. Default value: true.

  • UnitTest:*report-failed*

    true if you want to report failed assertions, and nil otherwise. Default value: true.

  • UnitTest:*report-passed*

    true if you want to report passed assertions, and nil otherwise. Default value: nil.

Using

  1. First, load the main file nl-unittest.lsp. You will have a defined context named UnitTest.
  2. Define a test case with: (define-test (test-name params) body*). Remember to have convention for test-name or you might suffer from symbols conflicting.
  3. Whenever you want to run a test case, call its in exactly the same way you call function.
  4. If you want to run all the test cases at the same time, name the test with the prefix test_ and call (UnitTest:run-all context-symbol).

TODO

  • Fix time calculation.
  • More options about output.
  • Separating output and results.
  • Assertions inside other forms (Done! Sun, 05 Jun 2011 00:34:31 +0700)

License

See COPYING for more details.

Links

[1]http://www.newlisp.org
[2]http://en.wikipedia.org/wiki/Lisp_(programming_language)

About

A simple unit testing framework for newLISP

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published