Do not fail unit test due to gdb abbreviating strings

gdb by default will only print strings up to 200 characters. After that
it abbreviates them. This affects the run-assert-msg-test.sh script if
the path to the glib installation is too long (in our case it was 133
characters, 132 would still have worked...)

By having gdb execute "set print elements 0" before printing the assert
string, the limit on maximum number of characters to print is set to
unlimited.

Signed-off-by: Peter Kjellerstedt <pkj@axis.com>

https://bugzilla.gnome.org/show_bug.cgi?id=670218
This commit is contained in:
Peter Kjellerstedt 2012-02-16 12:17:32 +01:00 committed by Colin Walters
parent 29f3e40e4e
commit 50efbaf063

View File

@ -34,7 +34,7 @@ if [ -e ".libs/lt-$msg_test" ]; then
msg_test="lt-$msg_test" msg_test="lt-$msg_test"
fi fi
echo_v "Running gdb on assert-msg-test" echo_v "Running gdb on assert-msg-test"
OUT=$(gdb --batch --ex run --ex "print (char*) __glib_assert_msg" .libs/$msg_test 2> $error_out) || \ OUT=$(gdb --batch --ex run --ex "set print elements 0" --ex "print (char*) __glib_assert_msg" .libs/$msg_test 2> $error_out) || \
fail "failed to run gdb" fail "failed to run gdb"
echo_v "Checking if assert message is in __glib_assert_msg" echo_v "Checking if assert message is in __glib_assert_msg"