signals: Fix leak in test
[platform/upstream/glib.git] / tests / run-assert-msg-test.sh
index ee20149..d4a5111 100755 (executable)
@@ -19,9 +19,17 @@ if [ "$1" = "-v" ]; then
   error_out=/dev/stderr
 fi  
 
+if [ -z "$LIBTOOL" ]; then
+  if [ -f ../libtool ]; then
+    LIBTOOL=../libtool
+  else
+    LIBTOOL=libtool
+  fi
+fi
+
 echo_v "Running assert-msg-test"
 OUT=$(./assert-msg-test 2>&1) && fail "assert-msg-test should abort"
-echo "$OUT" | grep -q '^ERROR:.*assert-msg-test.c:.*:.*main.*: assertion failed: (42 < 0)' || \
+echo "$OUT" | grep -q '^GLib:ERROR:.*assert-msg-test.c:.*:.*main.*: assertion failed: (42 < 0)' || \
   fail "does not print assertion message"
 
 if ! type gdb >/dev/null 2>&1; then
@@ -29,16 +37,11 @@ if ! type gdb >/dev/null 2>&1; then
   exit 0
 fi
 
-msg_test="assert-msg-test"
-if [ -e ".libs/lt-$msg_test" ]; then
-       msg_test="lt-$msg_test"
-fi
 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) || \
-  fail "failed to run gdb"
+OUT=$($LIBTOOL --mode=execute gdb --batch -x ${srcdir:-.}/assert-msg-test.gdb ./assert-msg-test 2> $error_out) || fail "failed to run gdb"
 
 echo_v "Checking if assert message is in __glib_assert_msg"
-if ! echo "$OUT" | grep -q '^$1.*"ERROR:.*assert-msg-test.c:.*:.*main.*: assertion failed: (42 < 0)"'; then
+if ! echo "$OUT" | grep -q '^$1.*"GLib:ERROR:.*assert-msg-test.c:.*:.*main.*: assertion failed: (42 < 0)"'; then
   fail "__glib_assert_msg does not have assertion message"
 fi