[PATCH 2/3] find-debuginfo: Add test for output files presence

Mark Wielaard mark@klomp.org
Wed Jan 14 22:33:02 GMT 2026


Hi Michal,

On Wed, Oct 29, 2025 at 04:11:54PM +0100, Michal Domonkos via Debugedit wrote:
> Signed-off-by: Michal Domonkos <mdomonko@redhat.com>
> ---
>  tests/find-debuginfo.at | 30 ++++++++++++++++++++++++++++++
>  1 file changed, 30 insertions(+)
> 
> diff --git a/tests/find-debuginfo.at b/tests/find-debuginfo.at
> index 26dcd2d..834f1af 100644
> --- a/tests/find-debuginfo.at
> +++ b/tests/find-debuginfo.at
> @@ -99,6 +99,13 @@ $CC $CFLAGS -Wl,--build-id -g3 -I. -o baz baz.c foo.c bar.c
>  cd ..
>  ]])
>  
> +# Names of all output files produced by find-debuginfo
> +m4_define([FIND_DEBUGINFO_OUTPUT_FILES],
> +[debugfiles.list
> +debuglinks.list
> +debugsources.list
> +elfbins.list])

Yes, when not -o or -S arguments are given.

>  # Run find-debuginfo on a small build without any fancy options
>  AT_SETUP([find-debuginfo sources])
>  AT_KEYWORDS([find-debuginfo] [sources])
> @@ -398,3 +405,26 @@ subdir_build/foobar.h
>  AT_CHECK([cat subdir_build/debugsources.list | tr '\0' '\n' | sort -u],
>           [0], [expout], [])
>  AT_CLEANUP
> +
> +# Run find-debuginfo on a small build and check all output files (and only
> +# those) were created
> +AT_SETUP([find-debuginfo output files])
> +AT_KEYWORDS([find-debuginfo] [sources] [debugdata] [gdb-index])

Lets just use the keywords [find-debuginfo] and [output] this check
isn't about sources, debugdata or gdb-index.

> +FIND_DEBUGINFO_PKG_BUILD_SETUP
> +# Make a snapshot of builddir, including the expected output files
> +AT_CHECK([(ls subdir_build;
> +           echo "FIND_DEBUGINFO_OUTPUT_FILES") | sort > expout],
> +         [0], [], [])

OK, sorted output of subdir_build plus expected output files.

> +# We need to set some environment variables for running find-debuginfo
> +# normally set by rpmbuild.
> +AT_CHECK([env RPM_BUILD_DIR=${PWD} \
> +              RPM_BUILD_ROOT=${PWD} \
> +              RPM_PACKAGE_NAME=pkg \
> +              RPM_PACKAGE_VERSION=ver \
> +              RPM_PACKAGE_RELEASE=rel \
> +              RPM_ARCH=arch \
> +          find-debuginfo ${PWD}/subdir_build],
> +         [0], [ignore], [])

OK, run on prepared builddir without any arguments.

> +# Check builddir against the snapshot
> +AT_CHECK([ls subdir_build | sort], [0], [expout], [])
> +AT_CLEANUP

And check the sorted subdir_build files match what we stored in
expout.

Looks good. There could also a check that uses -o and/or -S bit this
is probably enough.

Thanks,

Mark


More information about the Debugedit mailing list