mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-10-31 20:27:11 +01:00 
			
		
		
		
	Added warning if source file cannot be found
If source files are defined using relative paths, CMake will compile the tests, but this script will (sometimes) fail to find and parse the tests from the source files. I have added an explicit warning when ParseAndAddCatchTests fails to find a source file.
This commit is contained in:
		 Benjamin R. Jack
					Benjamin R. Jack
				
			
				
					committed by
					
						 Martin Hořeňovský
						Martin Hořeňovský
					
				
			
			
				
	
			
			
			 Martin Hořeňovský
						Martin Hořeňovský
					
				
			
						parent
						
							98e61c31df
						
					
				
				
					commit
					6f012f2d1d
				
			| @@ -48,6 +48,7 @@ endfunction() | ||||
| # Worker function | ||||
| function(ParseFile SourceFile TestTarget) | ||||
|     if(NOT EXISTS ${SourceFile}) | ||||
|         message(WARNING "Cannot find source file: ${SourceFile}") | ||||
|         return() | ||||
|     endif() | ||||
|     file(STRINGS ${SourceFile} Contents NEWLINE_CONSUME) | ||||
| @@ -111,4 +112,4 @@ function(ParseAndAddCatchTests TestTarget) | ||||
|     foreach(SourceFile ${SourceFiles}) | ||||
|         ParseFile(${SourceFile} ${TestTarget}) | ||||
|     endforeach() | ||||
| endfunction() | ||||
| endfunction() | ||||
|   | ||||
		Reference in New Issue
	
	Block a user