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 c7c9af6 commit dbb1649
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions pcre2/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,22 @@ build() {

check() {
cd "${srcdir}"/${pkgname}-${pkgver}

# 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 -j1 check

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_pcre2() {
Expand Down

0 comments on commit dbb1649

Please sign in to comment.