Fix bug in RunTest: not reporting failure in test 2, and fix bugs in RunTest

and RunTest.bat causing test 2 to fail when not building in source directory.
This commit is contained in:
Philip.Hazel 2020-11-22 15:16:05 +00:00
parent d19789c251
commit 9e15c97b6d
5 changed files with 19 additions and 5 deletions

View File

@ -94,6 +94,13 @@ any Linux version will work.
19. Fix ARM64 compilation warning in JIT. Patch by Carlo. 19. Fix ARM64 compilation warning in JIT. Patch by Carlo.
20. A bug in the RunTest script meant that if the first part of test 2 failed,
the failure was not reported.
21. Test 2 was failing when run from a directory other than the source
directory. This failure was previously missed in RunTest because of 20 above.
Fixes added to both RunTest and RunTest.bat.
Version 10.35 09-May-2020 Version 10.35 09-May-2020
--------------------------- ---------------------------

11
RunTest
View File

@ -493,15 +493,20 @@ for bmode in "$test8" "$test16" "$test32"; do
done done
fi fi
# PCRE2 tests that are not Perl-compatible: API, errors, internals # PCRE2 tests that are not Perl-compatible: API, errors, internals. We copy
# the testbtables file to the current directory for use by this test.
if [ $do2 = yes ] ; then if [ $do2 = yes ] ; then
echo $title2 "(excluding UTF-$bits)" echo $title2 "(excluding UTF-$bits)"
cp $testdata/testbtables .
for opt in "" $jitopt; do for opt in "" $jitopt; do
$sim $valgrind ${opt:+$vjs} ./pcre2test -q $setstack $bmode $opt $testdata/testinput2 testtry $sim $valgrind ${opt:+$vjs} ./pcre2test -q $setstack $bmode $opt $testdata/testinput2 testtry
if [ $? = 0 ] ; then saverc=$?
if [ $saverc = 0 ] ; then
$sim $valgrind ${opt:+$vjs} ./pcre2test -q $bmode $opt -error -70,-62,-2,-1,0,100,101,191,200 >>testtry $sim $valgrind ${opt:+$vjs} ./pcre2test -q $bmode $opt -error -70,-62,-2,-1,0,100,101,191,200 >>testtry
checkresult $? 2 "$opt" checkresult $? 2 "$opt"
else
checkresult $saverc 2 "$opt"
fi fi
done done
fi fi
@ -859,6 +864,6 @@ for bmode in "$test8" "$test16" "$test32"; do
done done
# Clean up local working files # Clean up local working files
rm -f testSinput test3input testsaved1 testsaved2 test3output test3outputA test3outputB teststdout teststderr testtry rm -f testbtables testSinput test3input testsaved1 testsaved2 test3output test3outputA test3outputB teststdout teststderr testtry
# End # End

View File

@ -26,6 +26,7 @@
@rem Updated for new test 14 (moving others up a number), August 2015. @rem Updated for new test 14 (moving others up a number), August 2015.
@rem Tidied and updated for new tests 21, 22, 23 by PH, October 2015. @rem Tidied and updated for new tests 21, 22, 23 by PH, October 2015.
@rem PH added missing "set type" for test 22, April 2016. @rem PH added missing "set type" for test 22, April 2016.
@rem PH added copy command for new testbtables file, November 2020
setlocal enabledelayedexpansion setlocal enabledelayedexpansion
@ -305,6 +306,7 @@ if %jit% EQU 1 call :runsub 1 testoutjit "Test with JIT Override" -q -jit
goto :eof goto :eof
:do2 :do2
copy /y %srcdir%\testdata\testbtables testbtables
call :runsub 2 testout "API, errors, internals, and non-Perl stuff" -q call :runsub 2 testout "API, errors, internals, and non-Perl stuff" -q
if %jit% EQU 1 call :runsub 2 testoutjit "Test with JIT Override" -q -jit if %jit% EQU 1 call :runsub 2 testoutjit "Test with JIT Override" -q -jit
goto :eof goto :eof

2
testdata/testinput2 vendored
View File

@ -5850,7 +5850,7 @@ a)"xI
/^\w+/tables=3 /^\w+/tables=3
École École
#loadtables ./testdata/testbtables #loadtables ./testbtables
/^\w+/tables=3 /^\w+/tables=3
École École

View File

@ -17597,7 +17597,7 @@ No match
** 'Tables = 3' is invalid: binary tables have not been loaded ** 'Tables = 3' is invalid: binary tables have not been loaded
École École
#loadtables ./testdata/testbtables #loadtables ./testbtables
/^\w+/tables=3 /^\w+/tables=3
École École