This is an automated email from the git hooks/post-receive script. guillem pushed a commit to branch main in repository dpkg.
View the commit online: https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=e14540db0d71d67f3eb4a07fae8570c29d1f053a commit e14540db0d71d67f3eb4a07fae8570c29d1f053a Author: Guillem Jover <[email protected]> AuthorDate: Wed Dec 8 03:25:29 2021 +0100 build: Move C test suite machinery into lib/dpkg/ This matches how we are driving the test suite in other parts of the project, and reduces one level of directory recursion. --- configure.ac | 1 - lib/dpkg/.gitignore | 1 + lib/dpkg/Makefile.am | 84 +++++++++++++++++++++++++++++++++++++++++--- lib/dpkg/t/.gitignore | 1 - lib/dpkg/t/Makefile.am | 85 --------------------------------------------- lib/dpkg/t/t-tarextract.t | 2 +- lib/dpkg/t/t-treewalk.t | 2 +- lib/dpkg/t/t-trigdeferred.t | 2 +- 8 files changed, 83 insertions(+), 95 deletions(-) diff --git a/configure.ac b/configure.ac index 025f7d713..403c24303 100644 --- a/configure.ac +++ b/configure.ac @@ -236,7 +236,6 @@ AC_CONFIG_FILES([ lib/compat/Makefile lib/dpkg/Makefile lib/dpkg/libdpkg.pc - lib/dpkg/t/Makefile doc/Doxyfile man/Makefile po/Makefile.in diff --git a/lib/dpkg/.gitignore b/lib/dpkg/.gitignore index c2143ff46..996ec5132 100644 --- a/lib/dpkg/.gitignore +++ b/lib/dpkg/.gitignore @@ -1 +1,2 @@ libdpkg.pc +t.tmp diff --git a/lib/dpkg/Makefile.am b/lib/dpkg/Makefile.am index 5716337f3..3735736de 100644 --- a/lib/dpkg/Makefile.am +++ b/lib/dpkg/Makefile.am @@ -1,10 +1,5 @@ ## Process this file with automake to produce Makefile.in -SUBDIRS = \ - . \ - t \ - # EOL - AM_CPPFLAGS = \ -DLOCALEDIR=\"$(localedir)\" \ -DCONFIGDIR=\"$(pkgconfdir)\" \ @@ -15,8 +10,15 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/lib \ # EOL +# Needed for the test suite +LDADD = \ + libdpkg.la \ + $(LIBINTL) \ + # EOL + EXTRA_DIST = \ + $(test_scripts) \ libdpkg.map \ libdpkg.pc.in \ # EOL @@ -173,3 +175,75 @@ pkginclude_HEADERS = \ varbuf.h \ version.h \ # EOL + +t_t_headers_cpp_SOURCES = \ + t/t-headers-cpp.cc \ + # EOL + +# The tests are sorted in order of increasing complexity. +test_programs = \ + t/t-test \ + t/t-test-skip \ + t/t-macros \ + t/t-headers-cpp \ + t/t-c-ctype \ + t/t-namevalue \ + t/t-ehandle \ + t/t-error \ + t/t-string \ + t/t-file \ + t/t-buffer \ + t/t-path \ + t/t-progname \ + t/t-subproc \ + t/t-command \ + t/t-pager \ + t/t-varbuf \ + t/t-ar \ + t/t-tar \ + t/t-deb-version \ + t/t-arch \ + t/t-version \ + t/t-pkginfo \ + t/t-pkg-list \ + t/t-pkg-queue \ + t/t-pkg-hash \ + t/t-pkg-show \ + t/t-fsys-dir \ + t/t-fsys-hash \ + t/t-trigger \ + t/t-mod-db \ + # EOL + +test_scripts = \ + t/t-tarextract.t \ + t/t-treewalk.t \ + t/t-trigdeferred.t \ + # EOL + +BENCHMARK_LDADD_FLAGS = \ + -lrt \ + $(LDADD) \ + # EOL + +t_b_fsys_hash_LDADD = $(BENCHMARK_LDADD_FLAGS) +t_b_pkg_hash_LDADD = $(BENCHMARK_LDADD_FLAGS) + +check_PROGRAMS = \ + $(test_programs) \ + t/b-fsys-hash \ + t/b-pkg-hash \ + t/c-tarextract \ + t/c-treewalk \ + t/c-trigdeferred \ + # EOL + +TEST_ENV_VARS = \ + DPKG_PROGTAR=$(TAR) \ + # EOL + +test_tmpdir = t.tmp + +include $(top_srcdir)/build-aux/check.am + +clean-local: check-clean diff --git a/lib/dpkg/t/.gitignore b/lib/dpkg/t/.gitignore index b711dbee7..25d36a75f 100644 --- a/lib/dpkg/t/.gitignore +++ b/lib/dpkg/t/.gitignore @@ -37,4 +37,3 @@ t-test-skip t-trigger t-varbuf t-version -t.tmp diff --git a/lib/dpkg/t/Makefile.am b/lib/dpkg/t/Makefile.am deleted file mode 100644 index d19be5d7b..000000000 --- a/lib/dpkg/t/Makefile.am +++ /dev/null @@ -1,85 +0,0 @@ -## Process this file with automake to produce Makefile.in - -AM_CPPFLAGS = \ - -DADMINDIR=\"$(admindir)\" \ - -idirafter $(top_srcdir)/lib/compat \ - -I$(top_builddir) \ - -I$(top_srcdir)/lib \ - # EOL -LDADD = \ - $(top_builddir)/lib/dpkg/libdpkg.la \ - $(LIBINTL) \ - # EOL - -EXTRA_DIST = \ - $(test_scripts) \ - # EOL - -TEST_ENV_VARS = \ - DPKG_PROGTAR=$(TAR) \ - # EOL - -t_headers_cpp_SOURCES = \ - t-headers-cpp.cc \ - # EOL - -# The tests are sorted in order of increasing complexity. -test_programs = \ - t-test \ - t-test-skip \ - t-macros \ - t-headers-cpp \ - t-c-ctype \ - t-namevalue \ - t-ehandle \ - t-error \ - t-string \ - t-file \ - t-buffer \ - t-path \ - t-progname \ - t-subproc \ - t-command \ - t-pager \ - t-varbuf \ - t-ar \ - t-tar \ - t-deb-version \ - t-arch \ - t-version \ - t-pkginfo \ - t-pkg-list \ - t-pkg-queue \ - t-pkg-hash \ - t-pkg-show \ - t-fsys-dir \ - t-fsys-hash \ - t-trigger \ - t-mod-db \ - # EOL - -test_scripts = \ - t-tarextract.t \ - t-treewalk.t \ - t-trigdeferred.t \ - # EOL - -BENCHMARK_LDADD_FLAGS = -lrt $(LDADD) - -b_fsys_hash_LDADD = $(BENCHMARK_LDADD_FLAGS) -b_pkg_hash_LDADD = $(BENCHMARK_LDADD_FLAGS) - -check_PROGRAMS = \ - $(test_programs) \ - b-fsys-hash \ - b-pkg-hash \ - c-tarextract \ - c-treewalk \ - c-trigdeferred \ - # EOL - -test_tmpdir = t.tmp - -include $(top_srcdir)/build-aux/check.am - -clean-local: check-clean diff --git a/lib/dpkg/t/t-tarextract.t b/lib/dpkg/t/t-tarextract.t index 3ee565421..a691c9601 100755 --- a/lib/dpkg/t/t-tarextract.t +++ b/lib/dpkg/t/t-tarextract.t @@ -154,7 +154,7 @@ TAR $expected =~ s/\n^.*dddd.*$//mg if $type eq 'v7'; $expected =~ s/\n^.*symlink-long.*$//mg if $type eq 'ustar'; - spawn(exec => [ './c-tarextract', "$dirtree.tar" ], + spawn(exec => [ "$builddir/t/c-tarextract", "$dirtree.tar" ], nocheck => 1, to_string => \$stdout, to_error => \$stderr); ok($? == 0, "tar extractor $type should succeed"); is($stderr, undef, "tar extractor $type stderr is empty"); diff --git a/lib/dpkg/t/t-treewalk.t b/lib/dpkg/t/t-treewalk.t index 6f379c81b..7061ae7b8 100755 --- a/lib/dpkg/t/t-treewalk.t +++ b/lib/dpkg/t/t-treewalk.t @@ -149,7 +149,7 @@ sub test_treewalker { $ENV{TREEWALK_SKIP} = $type eq 'skip' ? "$dirtree/cccc" : undef; - spawn(exec => [ './c-treewalk', $dirtree ], + spawn(exec => [ "$builddir/t/c-treewalk", $dirtree ], nocheck => 1, to_string => \$stdout, to_error => \$stderr); ok($? == 0, "tree walker $type should succeed"); is($stderr, undef, "tree walker $type stderr is empty"); diff --git a/lib/dpkg/t/t-trigdeferred.t b/lib/dpkg/t/t-trigdeferred.t index 21da412de..8893a429f 100755 --- a/lib/dpkg/t/t-trigdeferred.t +++ b/lib/dpkg/t/t-trigdeferred.t @@ -105,7 +105,7 @@ sub test_trigdeferred { foreach my $test (@deferred) { make_file("$admindir/triggers/Unincorp", $test->{original}); - spawn(exec => [ './c-trigdeferred', $admindir ], + spawn(exec => [ "$builddir/t/c-trigdeferred", $admindir ], nocheck => 1, to_string => \$stdout, error_to_string => \$stderr); my $exitcode = $? >> 8; -- Dpkg.Org's dpkg

