2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-17 01:32:12 +00:00

(merge from head) Add result-equal test which passes when the expected and result have the same elements.

[SVN r35719]
This commit is contained in:
Rene Rivera
2006-10-24 16:01:20 +00:00
parent 5e93d7f1a4
commit 1e84b3a1bf

View File

@@ -36,6 +36,35 @@ rule result ( expected * : rule-name args * : * )
}
}
rule .set.equal ( set1 * : set2 * )
{
if ( $(set1) in $(set2) ) && ( $(set2) in $(set1) )
{
return true ;
}
}
# assert that EXPECTED is equal to the result of calling RULE-NAME with the
# given arguments
rule result-equal ( expected * : rule-name args * : * )
{
local result ;
module [ CALLER_MODULE ]
{
modules.poke assert : result
: [ $(2) : $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : $(9) ] ;
}
if ! [ .set.equal $(result) : $(expected) ]
{
error-skip-frames 3 assertion failure: "[" $(rule-name)
[ lol->list $(args) : $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : $(9) ]
"]"
: expected: \"$(expected)\"
: got: \"$(result)\" ;
}
}
# assert that the given variable is nonempty.
rule nonempty-variable ( name )
{