Skip to content

Commit

Permalink
pcre2: work around incorrect assumptions in the test suite
Browse files Browse the repository at this point in the history
The tests verify that a certain amount of memory is allocated for given
patterns. The way those tests are implemented, these sizes are
hardcoded, and they work well as long as the code is compiled using
a 64-bit CPU architecture.

However, when compiling for i686, all of those numbers are off by 24.

Work around this for now.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed Jun 7, 2024
1 parent 562e0a6 commit abf0707
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion mingw-w64-pcre2/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,22 @@ build() {

check() {
cd "${srcdir}/build-${MSYSTEM}"
make check

# Work around bug in PCRE2 10.44
test i686 != "$CARCH" ||
for f in testdata/testoutput8-8-2 testdata/testoutput8-16-2 testdata/testoutput8-32-2
do
cp "../${_realname}-${pkgver}/$f" "../${_realname}-${pkgver}/$f.backup"
perl -pi -e 's{^(Memory allocation - compiled block : )(\d+)$}{$1 . ($2 - 24)}e' "../${_realname}-${pkgver}/$f"
done

make check || return 1

for f in testdata/testoutput8-8-2 testdata/testoutput8-16-2 testdata/testoutput8-32-2
do
test ! -f "../${_realname}-${pkgver}/$f.backup" ||
mv "../${_realname}-${pkgver}/$f.backup" "../${_realname}-${pkgver}/$f"
done
}

package() {
Expand Down

0 comments on commit abf0707

Please sign in to comment.