[glib] tests: multiple fixes to run-assert-msg-test.sh



commit 1d7985aa0adf7c22060470de727484e92f0a0eb9
Author: Dan Winship <danw gnome org>
Date:   Mon Nov 19 16:18:55 2012 -0500

    tests: multiple fixes to run-assert-msg-test.sh
    
    1) use "../libtool" rather than "libtool" to avoid problems
    with wacky OS X not-actually-libtool
    
    2) Use libtool on the libtool script, not the binary, so that it
    actually does anything
    
    3) Don't use "gdb --ex" since it's apparently new-ish/non-portable.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=684723

 tests/run-assert-msg-test.sh |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/tests/run-assert-msg-test.sh b/tests/run-assert-msg-test.sh
index b6045d6..338a14f 100755
--- a/tests/run-assert-msg-test.sh
+++ b/tests/run-assert-msg-test.sh
@@ -19,6 +19,14 @@ 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)' || \
@@ -29,13 +37,8 @@ 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=$(libtool --mode=execute 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"
+OUT=$((echo run; echo "set print elements 0"; echo "print (char*) __glib_assert_msg") | $LIBTOOL --mode=execute gdb --batch -x /dev/stdin 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



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]