2 # Run the same test compiled with -fstack-cleaner / f-no-stack-cleaner
3 # and compare the output.
17 die "Assertion failed: $@"
21 # If we don't have timeout, fake it:
22 if ! which timeout > /dev/null; then
32 timeout 30s ${bindir:=.}/bugged1_liveness_cleaner_$state \
33 ${srcdir:=.}/../../platforms/platform.xml \
34 ${srcdir:=.}/deploy_bugged1_liveness.xml \
35 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" \
36 --cfg=contexts/factory:ucontext \
37 --cfg=contexts/stack_size:256
38 assert 'test $? = 134'
42 echo "$1" | grep "Expanded pairs = " | sed "s/^.*Expanded pairs = //" | head -n1
45 RES_ON="$(run on 2>&1 1>/dev/null)"
46 RES_OFF="$(run off 2>&1 1>/dev/null)"
48 STATES_ON=$(get_states "$RES_ON")
49 STATES_OFF=$(get_states "$RES_OFF")
52 assert 'test -n "$STATES_ON"'
53 assert 'test -n "$STATES_OFF"'
55 # We expect 21 visited pairs with the stack cleaner:
56 assert 'test "$STATES_ON" = 21'
58 # We expect more states without the stack cleaner:
59 assert 'test "$STATES_ON" -lt "$STATES_OFF"'