Browse Source

Merge pull request #104 from ghalliday/bug83218

BUG:83218 Clean up the public regression suite

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 14 years ago
parent
commit
b160f0db67

+ 1 - 2
ecl/regress/r1.bat

@@ -18,7 +18,6 @@ rem     along with this program.  If not, see <http://www.gnu.org/licenses/>.
 rem ############################################################################## */
 
 setlocal enableextensions
-set inputfile=%1
 md %regresstgt% 2>nul
 call %~dp0\regress1 -m %*
-call bc "/filters=%inputfile%*" /expandall %regresstgt% %regresskey%
+if EXIST %~dp0\rcompare.bat. call %~dp0\rcompare %*

+ 1 - 3
ecl/regress/regress6.bat

@@ -18,7 +18,5 @@ rem     along with this program.  If not, see <http://www.gnu.org/licenses/>.
 rem ############################################################################## */
 
 setlocal
-set numParallel=6
-set files=*.ecl *.eclxml
-cmd /e:on /v:on /c regress.bat %files% %*
+call %~dp0\regress.bat -m *.ecl *.eclxml %*
 endlocal

+ 25 - 0
ecl/regress/rcompare.bat.sample

@@ -0,0 +1,25 @@
+@echo off
+rem /*##############################################################################
+rem
+rem     Copyright (C) 2011 HPCC Systems.
+rem
+rem     All rights reserved. This program is free software: you can redistribute it and/or modify
+rem     it under the terms of the GNU Affero General Public License as
+rem     published by the Free Software Foundation, either version 3 of the
+rem     License, or (at your option) any later version.
+rem
+rem     This program is distributed in the hope that it will be useful,
+rem     but WITHOUT ANY WARRANTY; without even the implied warranty of
+rem     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+rem     GNU Affero General Public License for more details.
+rem
+rem     You should have received a copy of the GNU Affero General Public License
+rem     along with this program.  If not, see <http://www.gnu.org/licenses/>.
+rem ############################################################################## */
+
+if '%1'=='' goto compareall;
+call "\Program Files (x86)\Beyond Compare 2"\bc2.exe "/filters=%1*" /expandall %regresstgt% %regresskey%
+goto end;
+:compareall
+call "\Program Files (x86)\Beyond Compare 2"\bc2.exe /expandall %regresstgt% %regresskey%
+:end

+ 10 - 9
ecl/regress/regress.bat

@@ -17,6 +17,8 @@ rem     You should have received a copy of the GNU Affero General Public License
 rem     along with this program.  If not, see <http://www.gnu.org/licenses/>.
 rem ############################################################################## */
 
+setlocal enableextensions enabledelayedexpansion
+
 if '%regresstgt%'=='' goto novars
 rd /s /q %regresstgt%
 md %regresstgt% 2>nul
@@ -24,19 +26,18 @@ md %regresstgt% 2>nul
 set flags=-P%regresstgt% -legacy -target=thorlcr -fforceGenerate -fdebugNlp=1 -fnoteRecordSizeInGraph -fregressionTest -b -m -S -shared -faddTimingToWorkunit=0 -fshowRecordCountInGraph
 set flags=%flags% %regressinclude%
 
-if NOT '%numParallel%'=='' goto multiway
+if NOT '%regressProcesses%'=='' goto multiway
 eclcc %flags% %* > out.log
-if '%nocompare%'=='1' goto done;
-call bc regressNew
-goto done
+goto compare;
+
 :multiway
-for /l %%c in (2,1,%numParallel%) do (
+for /l %%c in (2,1,%regressProcesses%) do (
    set ECL_CCLOG=cclog%%c.txt
-   start "Regress%%c" /min  eclcc -split %%c%%:%numParallel% %flags% %*
+   start "Regress%%c" /min  eclcc -split %%c%%:%regressProcesses% %flags% %*
 )
 
 set ECL_CCLOG=cclog1.txt
-eclcc -split 1:%numParallel% %flags% %*
+eclcc -split 1:%regressProcesses% %flags% %*
 set ECL_CCLOG=
 
 pause Press space when done
@@ -47,8 +48,8 @@ for %%f in (%regresstgt%\_batch_.*.log) do type %%f >> %regresstgt%\_batch_.tmp
 sort %regresstgt%\_batch_.tmp > %regresstgt%\_batch_.log
 del %regresstgt%\_batch_.tmp
 
-if '%nocompare%'=='1' goto done;
-call bc regressNew
+:compare
+if EXIST %~dp0\rcompare.bat. call %~dp0\rcompare %*
 goto done;
 
 :novars

+ 4 - 1
ecl/regress/setreg.bat

@@ -26,4 +26,7 @@ rem The directory that contains the "correct" results from a previous run
 set regresskey=c:\regression
 
 rem Any includes which need to be passed to eclcc
-set regressinclude=-Ic:\hpcc\HPCC-Platform\ecl\regress\modules
+set regressinclude=-I<hppc-directory>\ecl\regress\modules
+
+rem Number of processes to run in parallel from rall.bat
+set regressprocesses=7

+ 42 - 1
ecl/regress/sourcedoc.xml

@@ -4,6 +4,47 @@
     <title>ecl/regress</title>
 
     <para>
-        The ecl/regress directory contains the sources for the ecl/regress library.
+        The ecl/regress directory contains the sources for the compiler regression suite.  This regression suite is used to
+        check any changes to the eclcc compiler.  The recommended approach is
+    </para>
+
+    <orderedlist numeration="loweralpha">
+        <listitem>
+Run the regression suite and save the generated output.
+        </listitem>
+        <listitem>
+Make the changes to the source code.
+        </listitem>
+        <listitem>
+Re run the regression suite, compare the generated code, and check that all the changes are expected.
+        </listitem>
+    </orderedlist>
+
+
+    <para>
+        The regression suite should contain at least one example of any language feature that is added to the system.
+    </para>
+    <para>
+        To run the regression suite under windows:
+    <orderedlist numeration="loweralpha">
+        <listitem>
+Ensure path to eclcc is set up correctly
+        </listitem>
+        <listitem>
+Copy setreg.bat.sample to setreg.bat and modify the contents to reflect your set up.
+        </listitem>
+        <listitem>
+Copy rcompare.bat.sample to rcompare.bat and update to reflect your comparison program.
+        </listitem>
+    </orderedlist>
+
+        r1.bat.sample can be used to run the regression test for a single file, e.g.,
+        <programlisting>
+        r1 dataset.ecl
+</programlisting>
+To run the full regression test use rall.bat, e.g.,
+ <programlisting>
+        rall
+</programlisting>
     </para>
 </section>