[Pcre-svn] [665] code/trunk: Update Windows grep test script…

Top Page
Delete this message
Author: Subversion repository
Date:  
To: pcre-svn
Subject: [Pcre-svn] [665] code/trunk: Update Windows grep test script in line with the non-Windows version.
Revision: 665
          http://www.exim.org/viewvc/pcre2?view=rev&revision=665
Author:   ph10
Date:     2017-02-14 10:29:00 +0000 (Tue, 14 Feb 2017)
Log Message:
-----------
Update Windows grep test script in line with the non-Windows version.


Modified Paths:
--------------
    code/trunk/ChangeLog
    code/trunk/RunGrepTest.bat


Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog    2017-02-12 13:54:45 UTC (rev 664)
+++ code/trunk/ChangeLog    2017-02-14 10:29:00 UTC (rev 665)
@@ -2,8 +2,8 @@
 --------------------



-Version 10.23 16-January-2017
------------------------------
+Version 10.23 14-February-2017
+------------------------------

1. Extended pcre2test with the utf8_input modifier so that it is able to
generate all possible 16-bit and 32-bit code unit values in non-UTF modes.
@@ -357,7 +357,11 @@
next line instead of moving on to the end of the matched string, which can be
several lines after the start.

+56. Applied Jason Hood's new patch for RunGrepTest.bat that updates it in line
+with updates to the non-Windows version.

+
+
Version 10.22 29-July-2016
--------------------------


Modified: code/trunk/RunGrepTest.bat
===================================================================
--- code/trunk/RunGrepTest.bat    2017-02-12 13:54:45 UTC (rev 664)
+++ code/trunk/RunGrepTest.bat    2017-02-14 10:29:00 UTC (rev 665)
@@ -11,6 +11,8 @@


set PCRE2GREP_COLOUR=
set PCRE2GREP_COLOR=
+set PCREGREP_COLOUR=
+set PCREGREP_COLOR=
set GREP_COLORS=
set GREP_COLOR=

@@ -78,6 +80,12 @@
echo Default newline setting forced to LF
)

+:: Create a simple printf via cscript/JScript (an actual printf may translate
+:: LF to CRLF, which this one does not).
+
+echo WScript.StdOut.Write(WScript.Arguments(0).replace(/\\r/g, "\r").replace(/\\n/g, "\n")) >printf.js
+set printf=cscript //nologo printf.js
+
:: ------ Normal tests ------

echo Testing pcre2grep main features
@@ -572,6 +580,11 @@
(pushd %srcdir% & %pcre2grep% -tL "the" testdata/grepinput* & popd) >>testtrygrep
echo RC=^%ERRORLEVEL%>>testtrygrep

+echo ---------------------------- Test 119 ----------------------------->>testtrygrep
+%printf% "123\n456\n789\n---abc\ndef\nxyz\n---\n" >testNinputgrep
+%pcre2grep% -Mo "(\n|[^-])*---" testNinputgrep >>testtrygrep
+echo RC=^%ERRORLEVEL%>>testtrygrep
+
:: Now compare the results.

%cf% %srcdir%\testdata\grepoutput testtrygrep %cfout%
@@ -607,12 +620,10 @@
:: newline settings will work in environments where the normal newline sequence
:: is not \n. Do not use exported files, whose line endings might be changed.
:: Instead, create an input file so that its contents are exactly what we want.
-:: Note the messy fudge to create the input file. These tests are run in the
-:: build directory.
+:: These tests are run in the build directory.

echo Testing pcre2grep newline settings
-echo WScript.StdOut.Write(WScript.Arguments(0).replace(/\\r/g, "\r").replace(/\\n/g, "\n")) >testprint.js
-cscript //nologo testprint.js "abc\rdef\r\nghi\njkl" >testNinputgrep
+%printf% "abc\rdef\r\nghi\njkl" >testNinputgrep

echo ---------------------------- Test N1 ------------------------------>testtrygrep
%pcre2grep% -n -N CR "^(abc|def|ghi|jkl)" testNinputgrep >>testtrygrep
@@ -621,7 +632,7 @@
%pcre2grep% -n --newline=crlf "^(abc|def|ghi|jkl)" testNinputgrep >>testtrygrep

echo ---------------------------- Test N3 ------------------------------>>testtrygrep
-for /f %%a in ('cscript //nologo testprint.js "def\rjkl"') do set pattern=%%a
+for /f %%a in ('%printf% "def\rjkl"') do set pattern=%%a
%pcre2grep% -n --newline=cr -F "!pattern!" testNinputgrep >>testtrygrep

echo ---------------------------- Test N4 ------------------------------>>testtrygrep
@@ -654,13 +665,13 @@
:: is not checked.

echo Testing miscellaneous pcre2grep arguments (unchecked)
-cscript //nologo testprint.js "" >testtrygrep
+%printf% "" >testtrygrep
call :checkspecial "-xxxxx" 2 || exit /b 1
call :checkspecial "--help" 0 || exit /b 1
call :checkspecial "--line-buffered --colour=auto abc nul" 1 || exit /b 1

:: Clean up local working files
-del testcf testprint.js testNinputgrep teststderrgrep testtrygrep testtemp1grep testtemp2grep
+del testcf printf.js testNinputgrep teststderrgrep testtrygrep testtemp1grep testtemp2grep

exit /b 0