Skip to content

Commit

Permalink
Extend manual debuginfo test to cover the two other main scenarios
Browse files Browse the repository at this point in the history
Debuginfo is traditionally disabled in packages by defining
%debug_package to %{nil}, but since 4.20 we support the more formal
%_enable_debug_packages switch too. Test that, and also that it fails
if both automatic and manual debuginfo is specified.
  • Loading branch information
pmatilai committed Aug 29, 2024
1 parent 70e24ff commit 462aadf
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/data/SPECS/hello-debuginfo.spec
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
# inspecting it's output. Everybody else should use a simple noarch
# package which can be built under runroot in the test-suite.

%bcond customdebug 1

Summary: hello -- hello, world rpm
Name: hello
Version: 1.0
Expand All @@ -16,7 +18,10 @@ URL: http://rpm.org
Source0: hello-1.0.tar.gz
Patch0: hello-1.0-modernize.patch
Prefix: /usr

%if %{with customdebug}
%global debug_package %{nil}
%endif

%description
Simple rpm demonstration.
Expand Down
21 changes: 21 additions & 0 deletions tests/rpmbuild.at
Original file line number Diff line number Diff line change
Expand Up @@ -2460,6 +2460,27 @@ runroot rpm -qpl /build/RPMS/*/hello-debuginfo-1.0-1.*.rpm
/usr/lib/debug/test.txt
],
[ignore])

RPMTEST_CHECK([
runroot rpmbuild --quiet -bb \
--define "_prefix /usr/local" \
--without customdebug \
--define "_enable_debug_packages 0" \
/data/SPECS/hello-debuginfo.spec
],
[0],
[ignore],
[ignore])

RPMTEST_CHECK([
runroot rpmbuild --quiet -bb \
--define "_prefix /usr/local" \
--without customdebug \
/data/SPECS/hello-debuginfo.spec
],
[1],
[ignore],
[ignore])
RPMTEST_CLEANUP

AT_SETUP([explicit %_enable_debug_package on noarch])
Expand Down

0 comments on commit 462aadf

Please sign in to comment.