I have fixed the RunTest script by making it copy testdata/testbtables to the current directory before running test 2 (which now looks for ./testdata). Please can you advise me on the correct command to add to RunTest.bat to make it do the same. Is this right?
copy %srcdir%\testdata\testbtables testbtables I also added testbtables to the list of files that are deleted when RunTest completes. Regards, Philip On Sat, 21 Nov 2020 at 16:26, Philip Hazel <philip.ha...@gmail.com> wrote: > Thank you for reporting this. It turns out not to be Windows-specific, so > I can't use the "I'm not a Windows user" excuse. The same problem occurs > when building in a directory well out of the source directory on Linux. > However, a bug in the RunTest script prevented this failure from being > reported, so "make check" ran clean when it should not have. *That* bug is > easily fixed, but I am still pondering what to do about testing the > #loadtables feature of pcre2test. I will have to invent some way of passing > the source directory into pcre2test, or, alternatively, copying the > relevant file into the current directory before running the test, which > might be the way to go. This is quite timely, because 10.36-RC1 is > currently available for testing so it would be good to get this fixed > before the actual 10.36 release. > Regards, > Philip > > > On Fri, 20 Nov 2020 at 10:29, Daniel Richard G. <sk...@iskunk.org> wrote: > >> Hello list, >> >> I'd like to report a couple issues I encountered in building PCRE2 10.35 >> on Windows, specifically when it came to running the test suite. >> >> The first indication was a failed pcre2_test_bat: >> >> Test project C:/build/pcre/pcre2-10.35/build-test >> Start 1: pcre2_test_bat >> 1/2 Test #1: pcre2_test_bat ...................***Failed Required >> regular expression not found. Regex=[RunTest\.bat tests successfully >> completed >> ] 0.06 sec >> Start 2: pcre2_jit_test >> 2/2 Test #2: pcre2_jit_test ................... Passed 8.37 sec >> >> I tried running pcre2_test.bat directly, and got this: >> >> C:\build\pcre\pcre2-10.35\build-test>pcre2_test.bat >> source dir is "C:\build\pcre\pcre2-10.35" >> pcre2test="$<TARGET_FILE:pcre2test>" >> Error: "$<TARGET_FILE:pcre2test>" not found >> >> Either your build is incomplete or you have a configuration error. >> >> If configured with cmake and executed via "make test" or the MSVC >> "RUN_TESTS" >> project, pcre2_test.bat defines variables and automatically calls >> RunTest.bat. >> (remainder of text elided) >> >> This was the content of the batch file: >> >> C:\build\pcre\pcre2-10.35\build-test>more pcre2_test.bat >> @REM This is a generated file. >> @echo off >> setlocal >> SET srcdir="C:\build\pcre\pcre2-10.35" >> SET pcre2test="$<TARGET_FILE:pcre2test>" >> if not [%CMAKE_CONFIG_TYPE%]==[] SET >> pcre2test="C:\build\pcre\pcre2-10.35\build-test\%CMAKE_CONFIG_TYPE%\pcre2test.exe" >> call %srcdir%\RunTest.Bat >> if errorlevel 1 exit /b 1 >> echo RunTest.bat tests successfully completed >> >> $<TARGET_FILE:pcre2test> is a CMake directive that apparently didn't >> work. (I was using CMake 3.18.4.) >> >> I edited the batch file to use >> >> SET pcre2test="C:\build\pcre\pcre2-10.35\build-test\pcre2test.exe" >> >> and tried again. Now, I saw a different error: >> >> Test 2: "API, errors, internals, and non-Perl stuff" >> failed executing command-line: >> "C:\build\pcre\pcre2-10.35\build-test\pcre2test.exe" -q >> "C:\build\pcre\pcre2-10.35"\testdata\testinput2 >testout8\testoutput2 >> Test 2: "Test with JIT Override" >> failed executing command-line: >> "C:\build\pcre\pcre2-10.35\build-test\pcre2test.exe" -q >> -jit "C:\build\pcre\pcre2-10.35"\testdata\testinput2 >> >testoutjit8\testoutput2 >> >> (Same error for the 16-bit and 32-bit libraries.) >> >> I looked at the end of testoutput2, and saw this telltale: >> >> #loadtables ./testdata/testbtables >> ** Failed to open './testdata/testbtables': No such file or directory >> ** pcre2test run abandoned >> >> It seems that "#loadtables" is a new directive, that is not aware of the >> %srcdir% convention used in the RunTest.bat batch file for locating the >> testdata/ subdirectory. >> >> Here is a minimal patch that yielded a successful build+test for me, >> and should help point the way to a proper fix. (Note that the >> #loadtables tweak only works for a build tree just inside the source >> tree, as I was using): >> >> diff -ru pcre2-10.35/CMakeLists.txt pcre2-10.35-fixed/CMakeLists.txt >> --- pcre2-10.35/CMakeLists.txt 2020-05-09 11:43:10.000000000 -0400 >> +++ pcre2-10.35-fixed/CMakeLists.txt 2020-11-20 04:37:54.215894941 >> -0500 >> @@ -827,7 +827,7 @@ >> \@echo off >> setlocal >> SET srcdir=\"${winsrc}\" >> -SET pcre2test=\"${winexe}\" >> +SET pcre2test=\"${winbin}\\pcre2test.exe\" >> if not [%CMAKE_CONFIG_TYPE%]==[] SET >> pcre2test=\"${winbin}\\%CMAKE_CONFIG_TYPE%\\pcre2test.exe\" >> call %srcdir%\\RunTest.Bat >> if errorlevel 1 exit /b 1 >> diff -ru pcre2-10.35/testdata/testinput2 >> pcre2-10.35-fixed/testdata/testinput2 >> --- pcre2-10.35/testdata/testinput2 2020-04-24 11:35:58.000000000 >> -0400 >> +++ pcre2-10.35-fixed/testdata/testinput2 2020-11-20 >> 04:38:07.031894819 -0500 >> @@ -5850,7 +5850,7 @@ >> /^\w+/tables=3 >> École >> >> -#loadtables ./testdata/testbtables >> +#loadtables ../testdata/testbtables >> >> /^\w+/tables=3 >> École >> diff -ru pcre2-10.35/testdata/testoutput2 >> pcre2-10.35-fixed/testdata/testoutput2 >> --- pcre2-10.35/testdata/testoutput2 2020-04-24 11:36:22.000000000 >> -0400 >> +++ pcre2-10.35-fixed/testdata/testoutput2 2020-11-20 >> 04:47:36.907889384 -0500 >> @@ -17597,7 +17597,7 @@ >> ** 'Tables = 3' is invalid: binary tables have not been loaded >> École >> >> -#loadtables ./testdata/testbtables >> +#loadtables ../testdata/testbtables >> >> /^\w+/tables=3 >> École >> >> >> Please Cc: me on any replies, as I am not subscribed to this list. >> >> >> --Daniel >> >> >> -- >> Daniel Richard G. || sk...@iskunk.org >> My ASCII-art .sig got a bad case of Times New Roman. >> >> -- >> ## List details at https://lists.exim.org/mailman/listinfo/pcre-dev >> > -- ## List details at https://lists.exim.org/mailman/listinfo/pcre-dev