mirror of
				https://github.com/libssh2/libssh2.git
				synced 2025-10-30 12:05:34 +03:00 
			
		
		
		
	Add rules to generate a code coverage report.
This commit is contained in:
		
							
								
								
									
										23
									
								
								Makefile.am
									
									
									
									
									
								
							
							
						
						
									
										23
									
								
								Makefile.am
									
									
									
									
									
								
							| @@ -34,3 +34,26 @@ dist-hook: | |||||||
| 	  strip=`echo $$file | sed -e s/^$(srcdir)// -e s/\.dist//`; \ | 	  strip=`echo $$file | sed -e s/^$(srcdir)// -e s/\.dist//`; \ | ||||||
| 	  cp $$file $(distdir)$$strip; \ | 	  cp $$file $(distdir)$$strip; \ | ||||||
| 	done) | 	done) | ||||||
|  |  | ||||||
|  | # Code Coverage | ||||||
|  |  | ||||||
|  | init-coverage: | ||||||
|  | 	make clean | ||||||
|  | 	lcov --directory . --zerocounters | ||||||
|  |  | ||||||
|  | COVERAGE_CCOPTS ?= "-g --coverage" | ||||||
|  | COVERAGE_OUT ?= docs/coverage | ||||||
|  |  | ||||||
|  | build-coverage: | ||||||
|  | 	make CFLAGS=$(COVERAGE_CCOPTS) check | ||||||
|  | 	mkdir -p $(COVERAGE_OUT) | ||||||
|  | 	lcov --directory . --output-file $(COVERAGE_OUT)/$(PACKAGE).info \ | ||||||
|  | 		--capture | ||||||
|  |  | ||||||
|  | gen-coverage: | ||||||
|  | 	genhtml --output-directory $(COVERAGE_OUT) \ | ||||||
|  | 		$(COVERAGE_OUT)/$(PACKAGE).info \ | ||||||
|  | 		--highlight --frames --legend \ | ||||||
|  | 		--title "$(PACKAGE_NAME)" | ||||||
|  |  | ||||||
|  | coverage: init-coverage build-coverage gen-coverage | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user