From: Darafei Praliaskouski Date: Fri, 8 May 2026 14:23:45 +0000 (+0400) Subject: test(dist): cover tarball version metadata X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=2e73ef89c56ff298d9b35e0ae0cb7fb399567e83;p=thirdparty%2Fmtr.git test(dist): cover tarball version metadata --- diff --git a/Makefile.am b/Makefile.am index f18a7d7..ec2d140 100644 --- a/Makefile.am +++ b/Makefile.am @@ -8,12 +8,14 @@ EXTRA_DIST = \ sbin_PROGRAMS = mtr mtr-packet TESTS = \ test/capability-drop.py \ + test/dist-version.sh \ test/cmdparse.py \ test/param.py \ test/probe.py TEST_FILES = \ test/capability-drop.py \ + test/dist-version.sh \ test/cmdparse.py \ test/mtrpacket.py \ test/param.py \ diff --git a/test/dist-version.sh b/test/dist-version.sh new file mode 100755 index 0000000..833a24b --- /dev/null +++ b/test/dist-version.sh @@ -0,0 +1,29 @@ +#!/bin/sh +# +# mtr -- a network diagnostic tool +# Copyright (C) 2026 Darafei Praliaskouski +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. +# + +set -eu + +distdir=mtr-dist-version-test +expected_version=$(build-aux/git-version-gen .tarball-version) + +cleanup() { + rm -rf "$distdir" +} +trap cleanup EXIT INT TERM + +cleanup +"${MAKE:-make}" distdir distdir="$distdir" >/dev/null + +test -f "$distdir/.tarball-version" +actual_version=$(cat "$distdir/.tarball-version") +test "$actual_version" = "$expected_version" + +configure_version=$("$distdir/configure" --version | sed -n '1p') +test "$configure_version" = "mtr configure $expected_version"