diff --git a/TestSuite/2067.pas b/TestSuite/2067.pas index 26dabedc9..3402ada63 100644 --- a/TestSuite/2067.pas +++ b/TestSuite/2067.pas @@ -17,5 +17,5 @@ begin end; begin - Assert(1=0); -end. \ No newline at end of file + Assert(1=1); +end \ No newline at end of file diff --git a/_RebuildReleaseAndRunTestsForGitHubActions.bat b/_RebuildReleaseAndRunTestsForGitHubActions.bat index fba0da3fc..d34aa15d1 100644 --- a/_RebuildReleaseAndRunTestsForGitHubActions.bat +++ b/_RebuildReleaseAndRunTestsForGitHubActions.bat @@ -23,12 +23,12 @@ ExecHide.exe gacutil.exe /i ..\bin\Lib\PABCRtl.dll cd ..\bin REM MPGORunner.exe -TestRunner.exe 1 -TestRunner.exe 2 -TestRunner.exe 3 -TestRunner.exe 4 -TestRunner.exe 5 -TestRunner.exe 6 +TestRunner.exe 1 1 +TestRunner.exe 2 1 +TestRunner.exe 3 1 +TestRunner.exe 4 1 +TestRunner.exe 5 1 +TestRunner.exe 6 1 cd .. GOTO EXIT diff --git a/bin/TestRunner.exe b/bin/TestRunner.exe index 993299aca..e484f0503 100644 Binary files a/bin/TestRunner.exe and b/bin/TestRunner.exe differ diff --git a/bin/TestRunner.pas b/bin/TestRunner.pas index 5fc2e81ee..f94a0503e 100644 --- a/bin/TestRunner.pas +++ b/bin/TestRunner.pas @@ -11,7 +11,8 @@ uses PascalABCCompiler, System.IO, System.Diagnostics; var TestSuiteDir: string; - + nogui: boolean; + var PathSeparator: string := Path.DirectorySeparatorChar; @@ -56,13 +57,19 @@ begin comp.Compile(co); if comp.ErrorsList.Count = 0 then begin + if nogui then + raise new Exception('Compilation of error sample ' + files[i] + ' was successfull'); System.Windows.Forms.MessageBox.Show('Compilation of error sample ' + files[i] + ' was successfull' + System.Environment.NewLine); Halt(); end else if comp.ErrorsList.Count = 1 then begin if comp.ErrorsList[0].GetType() = typeof(PascalABCCompiler.Errors.CompilerInternalError) then + begin + if nogui then + raise new Exception('Compilation of ' + files[i] + ' failed' + System.Environment.NewLine + comp.ErrorsList[0].ToString()); System.Windows.Forms.MessageBox.Show('Compilation of ' + files[i] + ' failed' + System.Environment.NewLine + comp.ErrorsList[0].ToString()); + end; end; if i mod 50 = 0 then System.GC.Collect(); @@ -96,6 +103,8 @@ begin comp.Compile(co); if comp.ErrorsList.Count > 0 then begin + if nogui then + raise new Exception('Compilation of ' + files[i] + ' failed' + System.Environment.NewLine + comp.ErrorsList[0].ToString()); System.Windows.Forms.MessageBox.Show('Compilation of ' + files[i] + ' failed' + System.Environment.NewLine + comp.ErrorsList[0].ToString()); Halt(); end; @@ -130,6 +139,8 @@ begin comp.Compile(co); if comp.ErrorsList.Count > 0 then begin + if nogui then + raise new Exception('Compilation of ' + files[i] + ' failed' + System.Environment.NewLine + comp.ErrorsList[0].ToString()); System.Windows.Forms.MessageBox.Show('Compilation of ' + files[i] + ' failed' + System.Environment.NewLine + comp.ErrorsList[0].ToString()); Halt(); end; @@ -159,6 +170,8 @@ begin comp.Compile(co); if comp.ErrorsList.Count > 0 then begin + if nogui then + raise new Exception('Compilation of ' + files[i] + ' failed' + System.Environment.NewLine + comp.ErrorsList[0].ToString()); System.Windows.Forms.MessageBox.Show('Compilation of ' + files[i] + ' failed' + System.Environment.NewLine + comp.ErrorsList[0].ToString()); Halt(); end; @@ -186,6 +199,8 @@ begin comp.Compile(co); if comp.ErrorsList.Count > 0 then begin + if nogui then + raise new Exception('Compilation of ' + files[i] + ' failed' + System.Environment.NewLine + comp.ErrorsList[0].ToString()); System.Windows.Forms.MessageBox.Show('Compilation of ' + files[i] + ' failed' + System.Environment.NewLine + comp.ErrorsList[0].ToString()); Halt(); end; @@ -235,6 +250,8 @@ begin // Sleep(5); if p.ExitCode <> 0 then begin + if nogui then + raise new Exception('Running of ' + files[i] + ' failed. Exit code is not 0'); System.Windows.Forms.MessageBox.Show('Running of ' + files[i] + ' failed. Exit code is not 0'); Halt; end; @@ -344,6 +361,8 @@ begin try TestSuiteDir := GetTestSuiteDir; System.Environment.CurrentDirectory := Path.GetDirectoryName(GetEXEFileName()); + if (ParamCount = 2) and (ParamStr(2) = '1') then + nogui := true; if (ParamCount = 0) or (ParamStr(1) = '1') then begin DeletePCUFiles;