[ipxe-devel] Self tests in iPXE

Michael Brown mbrown at fensystems.co.uk
Fri Oct 14 14:51:27 UTC 2011


iPXE now includes a rudimentary self-test facility, which is inspired by 
Perl's Test::Simple.  For example:

    INIT_LIST_HEAD ( list );
    ok ( list_empty ( list ) );
    list_add ( entry, list );
    ok ( ! list_empty ( list ) );
    ok ( list_contains ( entry, list ) );

The basic idea is to make it trivially easy to write test code, with the ok() 
function taking care of reporting results, checking for assertion failures, 
etc.

I've implemented tests for the functions in list.h; the sample code is in 
tests/list_test.c.  If anyone wants to contribute tests for other areas of the 
code, that would be extremely welcome.  :)

Michael



More information about the ipxe-devel mailing list