From 292bcf4f7394292fe61d663b62ec73e55cd906c3 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Mon, 18 Aug 2025 00:00:31 +0300 Subject: add coverage script --- .gitignore | 1 + scripts/coverage | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100755 scripts/coverage diff --git a/.gitignore b/.gitignore index a31998e..c477976 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ build reports coverage +!scripts/coverage vgcore.* diff --git a/scripts/coverage b/scripts/coverage new file mode 100755 index 0000000..42db447 --- /dev/null +++ b/scripts/coverage @@ -0,0 +1,30 @@ +#!/bin/sh + +# build coverage server binary +make + +# not super fantastic but most likely good enough +export COVSRV_SOCKET=$(mktemp -u) + +# server program should always be killed at the end of a test run +cleanup() { + ./build/covsrv quit +} + +# kill server program even if user interrupted us or something else exceptional +# happened +trap interrupt INT HUP TERM +interrupt () { + cleanup + exit 1 +} + +# start coverage server, should create a unix socket at COVSRV_SOCKET that test +# programs can connect to +./build/covsrv & + +# run tests, pass any flags like -j to make +make coverage "$@" + +cleanup +exit 0 -- cgit v1.2.3