Commit 2664af56 authored by Thanassis Tsiodras's avatar Thanassis Tsiodras

Completely automatic coverage analysis execution over QEMU

parent 92087cbc
Pipeline #128 skipped
......@@ -155,24 +155,41 @@ deps.$(SUFFIX)/%.d: %.c
rm -f $@.$$$$
clean:
@rm -rf deps.* objs.* bin.*
coverage:
# Stuff to add in and automate:
#
# Spawning my custom-compiled Leon3 QEMU simulator:
#
# ~/tool-src/misc/qemu-Leon3/qemu-system-sparc -no-reboot \
# -nographic -M leon3_generic -m 64M -kernel \
# bin.debug.FPU.leon3/fputest -gdb tcp::9976 -S
#
# Spawning GDB:
#
# sparc-rtems4.11-gdb -x contrib/coverage.gdb
#
# Gathering the now local .gcda files and creating a nice report:
# lcov --capture --directory .. --output-file coverage.info
# genhtml coverage.info --output-directory coverage
@rm -rf deps.* objs.* bin.* coverage coverage.info
coverage-common:
$(MAKE) clean
$(MAKE) CFG=debug LEON=leon3 COVERAGE=1 FPU=1
# Spawning QEMU with our coverage enabled binary
~/tool-src/misc/qemu-Leon3/qemu-system-sparc -no-reboot \
-nographic -M leon3_generic -m 64M -kernel \
bin.debug.FPU.leon3.WITH_COVERAGE/fputest -gdb tcp::9976 -S &
# Spawning GDB and running the coverage script
sleep 2 ; sparc-rtems4.11-gdb -x contrib/coverage.gdb </dev/null
coverage: coverage-common
# Reporting the results
mkdir -p coverage ; \
cd coverage ; \
ln -s ../src ; \
sparc-rtems4.11-gcov ../objs.debug.FPU.leon3.WITH_COV*/*gcda
@echo
@echo ==================================================
@echo The coverage-annotated sources are under coverage/
@echo ==================================================
coverage-html: coverage-common
lcov --gcov-tool sparc-rtems4.11-gcov --capture --directory . \
--output-file coverage.info
genhtml coverage.info --output-directory coverage
@echo
@echo "===================================================="
@echo "Open coverage/index.html in your browser - e.g. via:"
@echo
@echo " xdg-open coverage/index.html"
@echo "===================================================="
.PHONY: clean coverage coverage-html coverage-common
# Unless "make clean" is called, include the dependency files
# which are auto-generated. Don't fail if they are missing
......
......@@ -6,9 +6,22 @@
# load bin.debug.FPU.leon3.WITH_COVERAGE/fputest
# Leon2
file bin.debug.FPU.leon2.WITH_COVERAGE/fputest
tar extended-remote me:1234
load bin.debug.FPU.leon2.WITH_COVERAGE/fputest
#
# file bin.debug.FPU.leon2.WITH_COVERAGE/fputest
# tar extended-remote me:1234
# load bin.debug.FPU.leon2.WITH_COVERAGE/fputest
# QEMU/Leon3
#
# Spawn the emulator first:
#
# ~/tool-src/misc/qemu-Leon3/qemu-system-sparc -no-reboot \
# -nographic -M leon3_generic -m 64M -kernel \
# bin.debug.FPU.leon3/fputest -gdb tcp::9976 -S
#
file bin.debug.FPU.leon3.WITH_COVERAGE/fputest
tar extended-remote 127.0.0.1:9976
load bin.debug.FPU.leon3.WITH_COVERAGE/fputest
# The coverage exporting to the host
b base.c:79
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment