Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
72 lines (55 sloc) 2.35 KB
title layout
Code Testing

General Testing

If you're writing a patch, using make check will cover most of rmw's operations. If there's a test missing, please open a ticket.

Testing the purge feature

Setting the RMWTRASH environmental variable at run-time to "fake-year" will write the year 1999 to the DeletionDate string in the .trashinfo file.

RMWTRASH=fake-year rmw some.txt temp.asc files.doc

Then run rmw with the purge option

rmw -fg


To get a profile of rmw using GNU gprof, first you'll need to rebuild rmw with different compiler flags. The easiest way to do that is

make clean
../configure --enable-debug=profile

Then run rmw with any parameters you like.

ex: ./rmw -l

That will produce a file called gmon.out. Now run gprof ./rmw gmon.out to view the results.

How to Create a Unit Test

This example shows how to create a unit test after adding a new function. In strings_rmw.c I've added the function bufchk_len(). The test I created for it is buffer_overrun.c; then I've added the test to test/ and re-ran 'automake'.

You can’t perform that action at this time.