From 42780f2e064d317e708cc017f57b7f6218402e52 Mon Sep 17 00:00:00 2001 From: Ivan Bondarev Date: Sun, 31 Oct 2021 13:48:32 +0100 Subject: [PATCH] fix in TestRunner --- bin/TestRunner.exe | Bin 43520 -> 44032 bytes bin/TestRunner.pas | 9 ++++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/bin/TestRunner.exe b/bin/TestRunner.exe index cf9c79ee284515d6e0685764cbbd3eea714c8fdf..dc72233406c150ecc8e8a9449765aba36a9886a1 100644 GIT binary patch delta 1276 zcmZvcU2GIp6vxk<+1>fr?xxc%(+|3`Q^htFWx)owSV&=ZQ|z+Deh4)6qm`~uDV=q; z5Y(_O4~iO5)+_p8OxncILX1j=5+5Wffs*)9Kx2d$6Pp-}fd^~i8)eJ6a~IMF?qtrr zzw`f}J9qBR-qBx$(d)vocWQf&<@%u5=0G5R;s=<-gus)*OZijVy=P_scF;AXreqGF z1eFXXYUs~o740T*tK;&rW* zq^eau30C?MtDK9^ynRm{@2vK5)v=PN3I4uDiej8f9VOF_x$RvMyV-VAz)tHLXXNZy z6g3}|NacbK{X~~^sF!qlp(jOjM|*y?I1=e+TdKp~avHy-`d2vlmA&ABe|B?fP`bbe zV*{MlyR>sJr)@5k4sz;IdePZ9#K}fYf-OZls=S7Dy+~gmDX?e6;?{4_>W8r+&A1fJ zaP69M5VbQ!`VX}L$TrvRxYS&v5|wF#MT)otS?+w?rLF^?fHr}RVKI3GK$!;9jwbNH`jtsg%D01;#$aL(yD z_?EOhK47PJ4O{l>@N8dpSKr{K&8BJX%M1*rZRhsLOt`fA`_DS|9FJ`pzjf_SKJ#(X zx%zp7Z00?_vct#AB{dwB<+8*1U=T4ZvMVGhm|%G~R};o7Aff$!E+|Pzbi;`Yse1}Gc ku0T^0%Z2%wyirc=i4UE~2(yOPtG2pMZED&dYi6XSloh4Us_SlwsYIfcqEettb3W*5>A z8ObRliYP3tkbW4mixSsrCAvro!-y^n!V7Og5DL=ln>o954s*^t@B5xJbC~(szi{p2 z+?DeyPR};hK(I{$N5V-sKrad$6E6q49_=<{2LQY@oy1!w0j%iEy#CK>?Ied?xNw zoVQ#EnG<=5bf|E(GirWeL0c7*76Ws*;r{>UXhRHB{u;oSJfiN%|3wUb{dj(NEG=;x z*%4LQeJ*4qdK^M1ALr>I#7~F4D}%W|-WvpOuN6@o*A#b>5%op!1s#U zhE(UC1>Pn?9kB{VSSHvx5t0Qf-BeXXtZGNqdj3p*t#&98rcCwt9R}(dg_|283|bB_ zN->v%5mFl%ZPDq+Ax6bI-D+f1X|Bek|1cv3Jpsmp)M;);syo8Gdq`%OJrl&I7!8M1 znVA8dUIl5w+=^bdk9jlbMZnc&M)Nwo3zF5MdB1~{q|+sZCD-XRd5qCUom|Hw7;e?E zNgb|!7-QLKX@lkbc5$zPDlKUa2Y*LY4BOy|*ai;%xp>;(V)yFHmIXd`5Gz7!b=nUE zJeYvMpgPvtA;gu`9IdTs%E^@^`LM5{sa^qBgHm7HA}c3Uxjm4u=+wmMclpzRceqmR zPM_W2R9&}IOj2iJrP zO=_rkwOVy*FNbYOA3$lDtL$^t&8gQzh2EZTkEIXIQCaj(pFQGWuqL%&8y)G3<9q=+ U-FMyWXJvgQQ?)(%NxIU6f9-<$UjP6A diff --git a/bin/TestRunner.pas b/bin/TestRunner.pas index c4010e4cf..b27c1b6ed 100644 --- a/bin/TestRunner.pas +++ b/bin/TestRunner.pas @@ -37,11 +37,12 @@ end; procedure CompileErrorTests(withide: boolean); begin - var comp := new Compiler(); + var files := Directory.GetFiles(TestSuiteDir + PathSeparator + 'errors', '*.pas'); for var i := 0 to files.Length - 1 do begin + var comp := new Compiler(); var content := &File.ReadAllText(files[i]); if content.StartsWith('//winonly') and IsUnix then continue; @@ -76,9 +77,11 @@ begin 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; - if (errorMessage <> '') and (comp.ErrorsList[0].Message.Trim <> errorMessage) then + if (errorMessage <> '') and (comp.ErrorsList[comp.ErrorsList.Count-1].Message.Trim <> errorMessage) then begin - System.Windows.Forms.MessageBox.Show('Wrong error message in file ' + files[i] + ', should '+errorMessage+', is '+comp.ErrorsList[0].Message); + if nogui then + raise new Exception('Wrong error message in file ' + files[i] + ', should '+errorMessage+', is '+comp.ErrorsList[comp.ErrorsList.Count-1].Message); + System.Windows.Forms.MessageBox.Show('Wrong error message in file ' + files[i] + ', should '+errorMessage+', is '+comp.ErrorsList[comp.ErrorsList.Count-1].Message); end; end; if i mod 50 = 0 then