mirror of
				https://github.com/TheLartians/ModernCppStarter.git
				synced 2025-10-31 02:01:33 +01:00 
			
		
		
		
	back to begining
needs to use doctest cmake modules ... it is not my idea!
This commit is contained in:
		
							parent
							
								
									a7e6d9f044
								
							
						
					
					
						commit
						b575afd39f
					
				
					 1 changed files with 7 additions and 7 deletions
				
			
		|  | @ -1,10 +1,6 @@ | ||||||
| cmake_minimum_required(VERSION 3.14 FATAL_ERROR) | cmake_minimum_required(VERSION 3.14 FATAL_ERROR) | ||||||
| 
 | 
 | ||||||
| project( | project(GreeterTests LANGUAGES CXX) | ||||||
|   GreeterTests |  | ||||||
|   VERSION 1.0 |  | ||||||
|   LANGUAGES CXX |  | ||||||
| ) |  | ||||||
| 
 | 
 | ||||||
| # ---- Options ---- | # ---- Options ---- | ||||||
| 
 | 
 | ||||||
|  | @ -26,7 +22,7 @@ CPMAddPackage( | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| if(TEST_INSTALLED_VERSION) | if(TEST_INSTALLED_VERSION) | ||||||
|   find_package(Greeter ${PROJECT_VERSION} EXACT REQUIRED) |   find_package(Greeter REQUIRED) | ||||||
| else() | else() | ||||||
|   CPMAddPackage(NAME Greeter SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/..) |   CPMAddPackage(NAME Greeter SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/..) | ||||||
| endif() | endif() | ||||||
|  | @ -60,7 +56,11 @@ endif() | ||||||
| 
 | 
 | ||||||
| enable_testing() | enable_testing() | ||||||
| 
 | 
 | ||||||
| add_test(NAME greeterTests COMMAND GreeterTests) | # Note: doctest and similar testing frameworks can automatically configure CMake tests. For other | ||||||
|  | # testing frameworks add the tests target instead: add_test(NAME greeterTests COMMAND GreeterTests) | ||||||
|  | 
 | ||||||
|  | include(${doctest_SOURCE_DIR}/scripts/cmake/doctest.cmake) | ||||||
|  | doctest_discover_tests(GreeterTests) | ||||||
| 
 | 
 | ||||||
| # ---- code coverage ---- | # ---- code coverage ---- | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue