mirror of
				https://github.com/threeal/cmake-action.git
				synced 2025-11-03 21:33:42 +00:00 
			
		
		
		
	add support to run hello world target as a CMake test
This commit is contained in:
		
							parent
							
								
									d59afd2844
								
							
						
					
					
						commit
						633b25cfad
					
				
							
								
								
									
										8
									
								
								.github/workflows/test.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										8
									
								
								.github/workflows/test.yml
									
									
									
									
										vendored
									
									
								
							@ -32,9 +32,7 @@ jobs:
 | 
				
			|||||||
        with:
 | 
					        with:
 | 
				
			||||||
          source-dir: test
 | 
					          source-dir: test
 | 
				
			||||||
          build-dir: output
 | 
					          build-dir: output
 | 
				
			||||||
 | 
					          run_test: true
 | 
				
			||||||
      - name: Run the build result
 | 
					 | 
				
			||||||
        run: output/hello_world
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
      - name: Check if the default build directory does not exist
 | 
					      - name: Check if the default build directory does not exist
 | 
				
			||||||
        run: test ! -d build && test ! -d test/build
 | 
					        run: test ! -d build && test ! -d test/build
 | 
				
			||||||
@ -98,6 +96,4 @@ jobs:
 | 
				
			|||||||
        with:
 | 
					        with:
 | 
				
			||||||
          source-dir: test
 | 
					          source-dir: test
 | 
				
			||||||
          generator: Ninja
 | 
					          generator: Ninja
 | 
				
			||||||
 | 
					          run-test: true
 | 
				
			||||||
      - name: Run the build result
 | 
					 | 
				
			||||||
        run: test/build/hello_world
 | 
					 | 
				
			||||||
 | 
				
			|||||||
@ -14,7 +14,9 @@ if(CHECK_SURPASS_WARNING)
 | 
				
			|||||||
  endif()
 | 
					  endif()
 | 
				
			||||||
endif()
 | 
					endif()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					enable_testing()
 | 
				
			||||||
add_executable(hello_world hello_world.cpp)
 | 
					add_executable(hello_world hello_world.cpp)
 | 
				
			||||||
 | 
					add_test(NAME hello_world COMMAND $<TARGET_FILE:hello_world>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
list(APPEND LANGS c cpp)
 | 
					list(APPEND LANGS c cpp)
 | 
				
			||||||
foreach(LANG ${LANGS})
 | 
					foreach(LANG ${LANGS})
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user