xref: /openbsd-src/gnu/usr.bin/perl/Porting/bisect-example.sh (revision 898184e3e61f9129feb5978fad5a8c6865f00b92)
1*898184e3Ssthen#!/bin/sh
2*898184e3Ssthenecho >&2 You need to edit this to run your test case
3*898184e3Ssthenexit 1
4*898184e3Ssthen
5*898184e3Ssthengit clean -dxf
6*898184e3Ssthen
7*898184e3Ssthen# If you get './makedepend: 1: Syntax error: Unterminated quoted
8*898184e3Ssthen# string' when bisecting versions of perl older than 5.9.5 this hack
9*898184e3Ssthen# will work around the bug in makedepend.SH which was fixed in
10*898184e3Ssthen# version 96a8704c. Make sure to uncomment 'git checkout makedepend.SH'
11*898184e3Ssthen# below too.
12*898184e3Ssthen#git show blead:makedepend.SH > makedepend.SH
13*898184e3Ssthen
14*898184e3Ssthen# If you can use ccache, add -Dcc=ccache\ gcc -Dld=gcc to the Configure line
15*898184e3Ssthen# if Encode is not needed for the test, you can speed up the bisect by
16*898184e3Ssthen# excluding it from the runs with -Dnoextensions=Encode
17*898184e3Ssthen# ie
18*898184e3Ssthen#./Configure -Dusedevel -Doptimize=-g -Dcc=ccache\ gcc -Dld=gcc -Dnoextensions=Encode -des
19*898184e3Ssthen./Configure -Dusedevel -Doptimize=-g -des
20*898184e3Ssthentest -f config.sh || exit 125
21*898184e3Ssthen# Correct makefile for newer GNU gcc
22*898184e3Ssthenperl -ni -we 'print unless /<(?:built-in|command)/' makefile x2p/makefile
23*898184e3Ssthen# if you just need miniperl, replace test_prep with miniperl
24*898184e3Ssthenmake test_prep
25*898184e3Ssthen[ -x ./perl ] || exit 125
26*898184e3Ssthen# This runs the actual testcase. You could use -e instead:
27*898184e3Ssthen./perl -Ilib ~/testcase.pl
28*898184e3Ssthenret=$?
29*898184e3Ssthen[ $ret -gt 127 ] && ret=127
30*898184e3Ssthengit checkout makedepend.SH
31*898184e3Ssthengit clean -dxf
32*898184e3Ssthenexit $ret
33*898184e3Ssthen
34*898184e3Ssthen#if you need to invert the exit code, replace the above exit with this:
35*898184e3Ssthen#[ $ret -eq 0 ] && exit 1
36*898184e3Ssthen#exit 0
37