]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
tests: make sure file restore traps are called correctly on AIX.
authorGary V. Vaughan <gary@gnu.org>
Thu, 8 Dec 2011 10:33:28 +0000 (17:33 +0700)
committerGary V. Vaughan <gary@gnu.org>
Thu, 8 Dec 2011 10:39:40 +0000 (17:39 +0700)
* 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 <gary@gnu.org>
tests/demo-noinst-link.test
tests/demo-relink.test
tests/depdemo-relink.test

index 5e658b00e01c8d3b18b5f535c42abad2363bc788..5654ff97bdc1985f59f26b3c8b3d5ea30c6e317c 100755 (executable)
@@ -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"
index b463441cbafe439c234d58dba7bd1f0354d0b604..4b32fba6a2e7e8968af32f5c4892b729456c6f3e 100755 (executable)
@@ -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
index 382f36cc558da74a1a226a72a1672d1d59e6979a..0d01279c35c2b3ea518f1630e1d339947c84a72d 100755 (executable)
@@ -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