Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong configuration of coverage-test in Makefile #56431

Open
zyscoder opened this issue Jan 2, 2025 · 0 comments
Open

Wrong configuration of coverage-test in Makefile #56431

zyscoder opened this issue Jan 2, 2025 · 0 comments

Comments

@zyscoder
Copy link

zyscoder commented Jan 2, 2025

Version

source code main branch

Platform


Subsystem

No response

What steps will reproduce the bug?

The configuration of coverage-test in Makefile is as follows:

.PHONY: coverage-test
coverage-test: coverage-build ## Run the tests and generate a coverage report.
	@if [ -d "out/Release/obj.target" ]; then \
		$(FIND) out/$(BUILDTYPE)/obj.target -name "*.gcda" -type f | xargs $(RM); \
	fi
	-NODE_V8_COVERAGE=coverage/tmp \
		TEST_CI_ARGS="$(TEST_CI_ARGS) --type=coverage" $(MAKE) $(COVTESTS)
	$(MAKE) coverage-report-js
	-(PYTHONPATH=./gcovr $(PYTHON) -m gcovr \
		--object-directory=out \
		--filter src -v \
		--root ./ \
		--html --html-details -o ../coverage/cxxcoverage.html \
		--gcov-executable="$(GCOV)")
	@printf "Javascript coverage %%: "
	@grep -B1 Lines coverage/index.html | head -n1 \
		| sed 's/<[^>]*>//g'| sed 's/ //g'
	@printf "C++ coverage %%: "
	@grep -A3 Lines coverage/cxxcoverage.html | grep style  \
		| sed 's/<[^>]*>//g'| sed 's/ //g'

The path of cxxcoverage.html is inconsistent (../coverage/cxxcoverage.html vs. coverage/cxxcoverage.html).

How often does it reproduce? Is there a required condition?

The wrong configuration results in trouble getting the C++ coverage.

What is the expected behavior? Why is that the expected behavior?

I guess the correct path of cxxcoverage.html should be:

coverage/cxxcoverage.html

What do you see instead?

Wrong path: ../coverage/cxxcoverage.html

Additional information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant