diff --git a/README.developer.md b/README.developer.md index 690b9d324b..8b3a7e1780 100644 --- a/README.developer.md +++ b/README.developer.md @@ -335,6 +335,8 @@ The package build process can be adjusted using following environment variables: - To skip installation of build dependencies this option should contain `yes` value. - `WITH_PYTHON` - To skip building python bluechi modules this option should contain `0`. +- `WITH_COVERAGE` + - To start collecting coverage this option should contain `1`. So for example following command will skip build dependencies installation and store create RPM packages into `output` subdirectory: diff --git a/bluechi.spec.in b/bluechi.spec.in index d99ef8cc9b..c190175956 100644 --- a/bluechi.spec.in +++ b/bluechi.spec.in @@ -3,6 +3,10 @@ %global with_python 1 %endif +# coverage collection is disabled by default , it can be enabled passing `--define "with_coverage 1"` option to rpmbuild +%if 0%{?with_coverage} +%global coverage_flags -Dwith_coverage=true +%endif Name: bluechi Version: @VERSION@ @@ -203,7 +207,7 @@ API description and manually written code to simplify recurring tasks. %autosetup %build -%meson -Dapi_bus=system +%meson -Dapi_bus=system %{?coverage_flags} %meson_build %if %{with_python} diff --git a/build-scripts/build-rpm.sh b/build-scripts/build-rpm.sh index 26c91d8e27..bd7e8130b0 100755 --- a/build-scripts/build-rpm.sh +++ b/build-scripts/build-rpm.sh @@ -12,6 +12,7 @@ fi rpmbuild \ --define "_topmdir rpmbuild" \ --define "_rpmdir rpmbuild" \ + --define "with_coverage ${WITH_COVERAGE:=0}"\ --define "with_python ${WITH_PYTHON:=1}" \ --rebuild rpmbuild/SRPMS/*src.rpm diff --git a/test.txt b/test.txt new file mode 100644 index 0000000000..2aea3530b5 --- /dev/null +++ b/test.txt @@ -0,0 +1,42 @@ +Directory already configured. + +Just run your build command (e.g. ninja) and Meson will regenerate as necessary. +If ninja fails, run "ninja reconfigure" or "meson setup --reconfigure" +to force Meson to regenerate. + +If build failures persist, run "meson setup --wipe" to rebuild from scratch +using the same options as passed when configuring the build. +To change option values, run "meson configure" instead. +Entering 'subprojects/hashmap.c' +Entering 'subprojects/inih' +setting SOURCE_DATE_EPOCH=1693785600 +Wrote: rpmbuild/SRPMS/bluechi-0.6.0-0.202309141037.git68fd4bd.fc37.src.rpm +RHEL8 CSB packages 0.0 B/s | 0 B 00:00 +Last metadata expiration check: 0:26:18 ago on Thu 14 Sep 2023 10:10:52 AM IDT. +Package checkpolicy-3.5-1.fc37.x86_64 is already installed. +Package gcc-12.3.1-1.fc37.x86_64 is already installed. +Package gcc-c++-12.3.1-1.fc37.x86_64 is already installed. +Package golang-github-cpuguy83-md2man-2.0.2-4.fc37.x86_64 is already installed. +Package meson-1.0.1-1.fc37.noarch is already installed. +Package python3-devel-3.11.4-1.fc37.x86_64 is already installed. +Package python3-setuptools-62.6.0-3.fc37.noarch is already installed. +Package selinux-policy-devel-37.22-1.fc37.noarch is already installed. +Package systemd-devel-251.14-2.fc37.x86_64 is already installed. +Package systemd-rpm-macros-251.14-2.fc37.noarch is already installed. +Package checkpolicy-3.5-1.fc37.x86_64 is already installed. +Package gcc-12.3.1-1.fc37.x86_64 is already installed. +Package gcc-c++-12.3.1-1.fc37.x86_64 is already installed. +Package golang-github-cpuguy83-md2man-2.0.2-4.fc37.x86_64 is already installed. +Package meson-1.0.1-1.fc37.noarch is already installed. +Package python3-devel-3.11.4-1.fc37.x86_64 is already installed. +Package python3-setuptools-62.6.0-3.fc37.noarch is already installed. +Package selinux-policy-devel-37.22-1.fc37.noarch is already installed. +Package systemd-devel-251.14-2.fc37.x86_64 is already installed. +Package systemd-rpm-macros-251.14-2.fc37.noarch is already installed. +Dependencies resolved. +Nothing to do. +Complete! +Installing rpmbuild/SRPMS/bluechi-0.6.0-0.202309141036.git68fd4bd.fc37.src.rpm +setting SOURCE_DATE_EPOCH=1693785600 +Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.6dUQhj +Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.TvLNpn