mirror of
				https://git.proxmox.com/git/mirror_frr
				synced 2025-10-31 09:04:27 +00:00 
			
		
		
		
	 8328420909
			
		
	
	
		8328420909
		
	
	
	
	
		
			
			Currently, make check runs the unit tests and reports pass/fail, but we have no way to guage how much of the code is covered by these tests. gcov provides those statistics on a per source file basis, but requires special CFLAGS and LDFLAGS. Here, we add the --enable-gcov configure option to setup those options correctly. We also add a make target called check-coverage, which runs the unit tests, runs gcov and uploads the data to the codecov.io cloud service for display. Finally, we include a Dockerfile-coverage which creates a container image in alpine linux to run the tests. To create the image: $ docker build \ --build-arg commit=`git rev-parse HEAD` \ --build-arg token=<upload token from codecov.io> \ -t frr-gcov:latest \ -f docker/alpine/Dockerfile-coverage . and to create and upload the report: $ docker run -it --rm frr-gcov:latest Testing done: Created and uploaded a report from my fork using alpine linux 3.7. Non-coverage alpine 3.7 build still works. Issue: https://github.com/FRRouting/frr/issues/2442 Signed-off-by: Arthur Jones <arthur.jones@riverbed.com>
		
			
				
	
	
		
			13 lines
		
	
	
		
			326 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			13 lines
		
	
	
		
			326 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| FROM alpine:3.7
 | |
| ARG commit
 | |
| ARG token
 | |
| ENV COMMIT=${commit}
 | |
| ENV TOKEN=${token}
 | |
| ADD . /src
 | |
| RUN cd /src && \
 | |
| 	source alpine/APKBUILD.in && \
 | |
| 	apk add --no-cache alpine-sdk $makedepends $checkdepends && \
 | |
| 	./bootstrap.sh && \
 | |
| 	./configure --enable-gcov
 | |
| ENTRYPOINT [ "/bin/sh", "-c", "cd /src && make && make -j 1 check-coverage" ]
 |