From: Gary V. Vaughan Date: Thu, 8 Dec 2011 10:33:28 +0000 (+0700) Subject: tests: make sure file restore traps are called correctly on AIX. X-Git-Tag: v2.4.2.418~207 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ccd0cea1a598f59287e97f2dbc0204f04965d004;p=thirdparty%2Flibtool.git tests: make sure file restore traps are called correctly on AIX. * tests/demo-noinst-link.test (func_save_files): set the restore trap outside a function, otherwise AIX 5.3 /bin/sh will run the trap at the end of the function, instead of when the script exits. * tests/demo-relink.test (func_save_files): Ditto. * tests/depdemo-relink.test (func_save_files): Ditto. Reported by Stefano Lattarini. Signed-off-by: Gary V. Vaughan --- diff --git a/tests/demo-noinst-link.test b/tests/demo-noinst-link.test index 5e658b00e..5654ff97b 100755 --- a/tests/demo-noinst-link.test +++ b/tests/demo-noinst-link.test @@ -38,13 +38,16 @@ func_save_files () func_mkdir_p "$objdir/temp/libs" cp -f libhello.la "hell$EXEEXT" "$objdir/temp" cp -f "$objdir"/* "$objdir"/temp/libs - trap "func_restore_files" 0 1 2 13 15 } func_require "demo-inst" "$prefix/lib/libhello.la" func_mkprefixdir func_cd "tests/demo" + +# AIX 5.3 `/bin/sh' will invoke the trap for 0 at the end of a +# function, so we set the trap outside of a function to be portable. +trap func_restore_files 0 1 2 13 15 func_save_files func_msg "removing \`libhello.la' and \`hell' from demo" diff --git a/tests/demo-relink.test b/tests/demo-relink.test index b463441cb..4b32fba6a 100755 --- a/tests/demo-relink.test +++ b/tests/demo-relink.test @@ -37,7 +37,6 @@ func_save_files () func_mkdir_p "$objdir/temp/libs" cp -f libhello.la "$objdir/temp" cp -f "$objdir"/libhello.* "$objdir/lt-hell$EXEEXT" "$objdir/temp/libs" - trap "func_restore_files" 0 1 2 13 15 } func_require "demo-inst" "$prefix/lib/libhello.la" "tests/demo/libhello.la" @@ -50,7 +49,10 @@ func_get_config "library_names" "cat libhello.la" test -z "$library_names" \ && func_skip "Exiting: demo/libhello.la is not a shared library" +# AIX 5.3 `/bin/sh' will invoke the trap for 0 at the end of a +# function, so we set the trap outside of a function to be portable. func_save_files +trap func_restore_files 0 1 2 13 15 func_get_config 'shlibpath_overrides_runpath hardcode_action diff --git a/tests/depdemo-relink.test b/tests/depdemo-relink.test index 382f36cc5..0d01279c3 100755 --- a/tests/depdemo-relink.test +++ b/tests/depdemo-relink.test @@ -47,7 +47,6 @@ func_save_files () && cp -f "$objdir/depdemo$EXEEXT" "_fnord/temp" cp -f l3/libl3.la "_fnord/temp" cp -f l3/"$objdir"/* "_fnord/temp/libs" - trap "func_restore_files" 0 1 2 13 15 } func_require "depdemo-inst" "$prefix/lib/libl3.la" "tests/depdemo/l3/libl3.la" @@ -60,6 +59,9 @@ func_get_config "library_names" "cat l3/libl3.la" test -z "$library_names" \ && func_skip "Exiting: depdemo/l3/libl3.la is not a shared library" +# AIX 5.3 `/bin/sh' will invoke the trap for 0 at the end of a +# function, so we set the trap outside of a function to be portable. +trap func_restore_files 0 1 2 13 15 func_save_files func_get_config 'shlibpath_overrides_runpath