Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of boost. Click here for the latest Boost documentation.

tools/build/v2/test/assert-equal.jam

# Evaluates [ rulename arg1... : arg2... : ... : argN... ] and compares the
# result to expected-results. If there is a mismatch, prints an error message
# and exits.
rule assert-equal ( expected-results *
    : rulename a1 * :  a2 * : a3 * : a4 * : a5 * : a6 * : a7 * : a8 * : a9 * )
{

    local results = [ $(rulename) $(a1) : $(a2) : $(a3)
                        : $(a4) : $(a5) : $(a6) : $(a7) : $(a8) ] ;
                      
    if $(results) != $(expected-results)
    {
        EXIT ******ASSERTION FAILURE******* "
    [ $(rulename) " $(a1)
        ": "$(a2[1]) $(a2[2-])
        ": "$(a3[1]) $(a3[2-])
        ": "$(a4[1]) $(a4[2-])
        ": "$(a5[1]) $(a5[2-])
        ": "$(a6[1]) $(a6[2-])
        ": "$(a7[1]) $(a7[2-])
        ": "$(a8[1]) $(a8[2-]) "]
expected:
    (" $(expected-results) ")
result was:
    (" $(results) ")"
       ;
    
    }
}