examples: beware of portability issues with sh's trap

On AIX 7.2, when invoking "exit 77", we actually exit with 127.  The
"cleanup" function, called via trap, received an incorrect exit
status, something described in Autoconf's doc.
Reported by Bruno Haible.
https://lists.gnu.org/archive/html/bug-bison/2020-05/msg00029.html
https://lists.gnu.org/archive/html/bug-bison/2020-05/msg00047.html

* examples/test (skip): New.
* examples/c/bistromathic/bistromathic.test,
* examples/c/reccalc/reccalc.test: Use it, to ensure $? is set to 77
when the trap is called.
This commit is contained in:
Akim Demaille
2020-05-04 06:25:04 +02:00
parent f1497356e8
commit 6135fdc152
3 changed files with 16 additions and 3 deletions

View File

@@ -15,7 +15,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
(seq 0) >/dev/null 2>&1 || exit 77
(seq 0) >/dev/null 2>&1 || skip "gimme one seq"
cat >input <<EOF
1+2*3