2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-15 13:02:11 +00:00
Files
build/v2/test/assert-equal.jam
Dave Abrahams ae95218335 initial checkin
[SVN r10901]
2001-08-20 10:39:42 +00:00

39 lines
1.0 KiB
Plaintext

# assert-equal expected-results... : rule-name arg1... : arg2... : ...argN ;
#
# Evaluates [ rule-name arg1... : arg2... : ... : argN... ] and compares the
# result to expected-results. If there is a mismatch, prints an error message
# and exits.
rule assert-equal
{
local expected = $(<) ;
local rulename = $(>[1]) ;
if ( ! $(rulename) ) || $(rulename) = ""
{
report-argument-error assert-equal 1 2[1] : $(1) : $(2) :
$(3) : $(4) : $(5) : $(6) : $(7) : $(8) : $(9) ;
}
local results = [ $(rulename) $(>[2-]) : $(3) : $(4) : $(5)
: $(6) : $(7) : $(8) : $(9) ] ;
if $(results) != $(<)
{
EXIT ******ASSERTION FAILURE******* "
[ $(rulename) " $(>[2-])
": "$(3[1]) $(3[2-])
": "$(4[1]) $(4[2-])
": "$(5[1]) $(5[2-])
": "$(6[1]) $(6[2-])
": "$(7[1]) $(7[2-])
": "$(8[1]) $(8[2-])
": "$(9[1]) $(9[2-]) "]
expected:
(" $(expected) ")
result was:
(" $(results) ")"
;
}
}