mirror of
				https://gitlab.com/freepascal.org/lazarus/lazarus.git
				synced 2025-10-31 04:41:42 +01:00 
			
		
		
		
	lazarus tests: console test runner stores test environment data in the test results
git-svn-id: trunk@16057 -
This commit is contained in:
		
							parent
							
								
									42e0b8c301
								
							
						
					
					
						commit
						64c7eb142a
					
				| @ -56,7 +56,7 @@ type | |||||||
|     procedure AppendLongOpts; virtual; |     procedure AppendLongOpts; virtual; | ||||||
|     procedure WriteCustomHelp; virtual; |     procedure WriteCustomHelp; virtual; | ||||||
|     procedure ParseOptions; virtual; |     procedure ParseOptions; virtual; | ||||||
|     procedure ExtendXmlDocument(Doc: TXMLDocument); |     procedure ExtendXmlDocument(Doc: TXMLDocument); virtual; | ||||||
|     function GetResultsWriter: TCustomResultsWriter; virtual; |     function GetResultsWriter: TCustomResultsWriter; virtual; | ||||||
|   public |   public | ||||||
|     constructor Create(AOwner: TComponent); override; |     constructor Create(AOwner: TComponent); override; | ||||||
|  | |||||||
| @ -100,7 +100,7 @@ Resourcestring | |||||||
| 
 | 
 | ||||||
| function TSQLFirebirdFileNamePropertyEditor.GetFilter: String; | function TSQLFirebirdFileNamePropertyEditor.GetFilter: String; | ||||||
| begin | begin | ||||||
|   Result := sFireBirdDatabases+' (*.fb)|*.fb;*.fdb'; |   Result := sFireBirdDatabases+' (*.fb;*.fdb)|*.fb;*.fdb'; | ||||||
|   Result := Result + '|' + sInterbaseDatabases  +' (*.gdb)|*.gdb;*.GDB'; |   Result := Result + '|' + sInterbaseDatabases  +' (*.gdb)|*.gdb;*.GDB'; | ||||||
|   Result:= Result+ '|'+ inherited GetFilter; |   Result:= Result+ '|'+ inherited GetFilter; | ||||||
| end; | end; | ||||||
|  | |||||||
| @ -17,7 +17,7 @@ | |||||||
|     <RunParams> |     <RunParams> | ||||||
|       <local> |       <local> | ||||||
|         <FormatVersion Value="1"/> |         <FormatVersion Value="1"/> | ||||||
|         <CommandLineParams Value="-a --file=results.xml"/> |         <CommandLineParams Value="-s bugs.2068 --file=results.xml"/> | ||||||
|         <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> |         <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> | ||||||
|       </local> |       </local> | ||||||
|     </RunParams> |     </RunParams> | ||||||
| @ -47,14 +47,14 @@ | |||||||
|         <UnitName Value="TestLpi"/> |         <UnitName Value="TestLpi"/> | ||||||
|       </Unit1> |       </Unit1> | ||||||
|       <Unit2> |       <Unit2> | ||||||
|         <Filename Value="..\components\fpcunit\console\fpcunitproject1.pas"/> |  | ||||||
|         <IsPartOfProject Value="True"/> |  | ||||||
|         <UnitName Value="FPCUnitProject1"/> |  | ||||||
|       </Unit2> |  | ||||||
|       <Unit3> |  | ||||||
|         <Filename Value="bugtestcase.pas"/> |         <Filename Value="bugtestcase.pas"/> | ||||||
|         <IsPartOfProject Value="True"/> |         <IsPartOfProject Value="True"/> | ||||||
|         <UnitName Value="BugTestCase"/> |         <UnitName Value="BugTestCase"/> | ||||||
|  |       </Unit2> | ||||||
|  |       <Unit3> | ||||||
|  |         <Filename Value="testglobals.pas"/> | ||||||
|  |         <IsPartOfProject Value="True"/> | ||||||
|  |         <UnitName Value="testglobals"/> | ||||||
|       </Unit3> |       </Unit3> | ||||||
|     </Units> |     </Units> | ||||||
|   </ProjectOptions> |   </ProjectOptions> | ||||||
|  | |||||||
| @ -22,7 +22,9 @@ program runtests; | |||||||
| 
 | 
 | ||||||
| uses | uses | ||||||
|   Classes, consoletestrunner, |   Classes, consoletestrunner, | ||||||
|   testglobals, testunits; |   testglobals, testunits, dom, | ||||||
|  |   {Unit needed to set the LCL version and widget set name} | ||||||
|  |   LCLVersion, InterfaceBase, Interfaces; | ||||||
|    |    | ||||||
| type | type | ||||||
| 
 | 
 | ||||||
| @ -33,6 +35,8 @@ type | |||||||
|     procedure AppendLongOpts; override; |     procedure AppendLongOpts; override; | ||||||
|     procedure ParseOptions; override; |     procedure ParseOptions; override; | ||||||
|     procedure WriteCustomHelp; override; |     procedure WriteCustomHelp; override; | ||||||
|  | 
 | ||||||
|  |     procedure ExtendXmlDocument(Doc: TXMLDocument); override; | ||||||
|   end; |   end; | ||||||
| 
 | 
 | ||||||
| { TLazTestRunner } | { TLazTestRunner } | ||||||
| @ -55,6 +59,29 @@ begin | |||||||
|   writeln('  --compiler=<ppcxxx>       use ppcxxx to build test projects'); |   writeln('  --compiler=<ppcxxx>       use ppcxxx to build test projects'); | ||||||
| end; | end; | ||||||
| 
 | 
 | ||||||
|  | procedure TLazTestRunner.ExtendXmlDocument(Doc: TXMLDocument); | ||||||
|  | var | ||||||
|  |   env: TDOMElement; | ||||||
|  |   procedure AddElement(const name, value: string); | ||||||
|  |   var | ||||||
|  |     n: TDOMElement; | ||||||
|  |   begin | ||||||
|  |     n := Doc.CreateElement(name); | ||||||
|  |     n.AppendChild(Doc.CreateTextNode(value)); | ||||||
|  |     env.AppendChild(n); | ||||||
|  |   end; | ||||||
|  | begin | ||||||
|  |   inherited ExtendXmlDocument(Doc); | ||||||
|  |   env := Doc.CreateElement('Environment'); | ||||||
|  |   AddElement('Date', {$I %DATE%}); | ||||||
|  |   AddElement('CPU', {$I %FPCTARGETCPU%}); | ||||||
|  |   AddElement('OS', {$I %FPCTARGETOS%}); | ||||||
|  |   AddElement('FPCVersion', {$I %FPCVERSION%}); | ||||||
|  |   AddElement('LCLVersion', lcl_version); | ||||||
|  |   AddElement('WidgetSet', LCLPlatformDirNames[WidgetSet.LCLPlatform]); | ||||||
|  |   Doc.FirstChild.AppendChild(env); | ||||||
|  | end; | ||||||
|  | 
 | ||||||
| var | var | ||||||
|   App: TLazTestRunner; |   App: TLazTestRunner; | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -23,16 +23,16 @@ | |||||||
|     </RunParams> |     </RunParams> | ||||||
|     <RequiredPackages Count="4"> |     <RequiredPackages Count="4"> | ||||||
|       <Item1> |       <Item1> | ||||||
|         <PackageName Value="CodeTools"/> |         <PackageName Value="LCL"/> | ||||||
|       </Item1> |       </Item1> | ||||||
|       <Item2> |       <Item2> | ||||||
|         <PackageName Value="FCL"/> |         <PackageName Value="FPCUnitTestRunner"/> | ||||||
|       </Item2> |       </Item2> | ||||||
|       <Item3> |       <Item3> | ||||||
|         <PackageName Value="FPCUnitTestRunner"/> |         <PackageName Value="FCL"/> | ||||||
|       </Item3> |       </Item3> | ||||||
|       <Item4> |       <Item4> | ||||||
|         <PackageName Value="LCL"/> |         <PackageName Value="CodeTools"/> | ||||||
|       </Item4> |       </Item4> | ||||||
|     </RequiredPackages> |     </RequiredPackages> | ||||||
|     <Units Count="7"> |     <Units Count="7"> | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 vincents
						vincents