Chapter 16. Making Lire “Test-infected

Table of Contents

Unit Tests in Lire
PerlUnit
Writing Tests
Running Tests
Some Best Practices on Unit Testing

Soon after the release of Lire 1.2.1, unit tests were introduced in the source tree. Unit tests helps development in several way the most important one being that you can make changes to code and run the unit tests to make sure that nothing was broken by that changes.

You can find helpful resources on Unit testing on the PerlUnit home page as well as on the JUnit home page from which it was inspired.

Unit Tests in Lire

PerlUnit

Unit tests are written using the PerlUnit framework. You'll to install version 0.24 or later of the Test::Unit to run the unit tests.

Note

Unfortunately, PerlUnit needs version 5.6.0 or later of perl. So you can't run the unit tests on previous version of perl, altough Lire should be able to run under 5.00503.