From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 91722 invoked by alias); 16 Mar 2019 23:45:25 -0000 Mailing-List: contact dwz-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: dwz-owner@sourceware.org Received: (qmail 91459 invoked by uid 89); 16 Mar 2019 23:45:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.100.2 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.1 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.1 spammy=20190317, 2019-03-17, HX-Languages-Length:1869 X-Spam-Status: No, score=-25.1 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on sourceware.org X-Spam-Level: X-HELO: mx1.suse.de X-Virus-Scanned: by amavisd-new at test-mx.suse.de Date: Tue, 01 Jan 2019 00:00:00 -0000 From: Tom de Vries To: dwz@sourceware.org, jakub@redhat.com Subject: [committed] Add hardlink-multifile.sh test-case Message-ID: <20190316234546.GA29313@delia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-SW-Source: 2019-q1/txt/msg00145.txt.bz2 Hi, Add test-case that checks that dwz -h maintains hardlinks in multifile mode. Committed to trunk. Thanks, - Tom Add hardlink-multifile.sh test-case 2019-03-17 Tom de Vries * testsuite/scripts/hardlinks-p.sh: New script. * testsuite/dwz.tests/hardlink.sh: Use hardlinks-p.sh. * testsuite/dwz.tests/hardlink-multifile.sh: New test. --- testsuite/dwz.tests/hardlink-multifile.sh | 15 +++++++++++++++ testsuite/dwz.tests/hardlink.sh | 4 +--- testsuite/scripts/hardlinks-p.sh | 16 ++++++++++++++++ 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/testsuite/dwz.tests/hardlink-multifile.sh b/testsuite/dwz.tests/hardlink-multifile.sh new file mode 100644 index 0000000..91d25e3 --- /dev/null +++ b/testsuite/dwz.tests/hardlink-multifile.sh @@ -0,0 +1,15 @@ +cp ../hello 1 +ln 1 2 +cp ../hello 3 + +dwz -h -m 4 1 2 3 + +hardlinks-p.sh 1 2 + +smaller-than.sh 1 ../hello +smaller-than.sh 3 ../hello + +[ "$(gnu-debugaltlink-name.sh 1)" = "4" ] +[ "$(gnu-debugaltlink-name.sh 3)" = "4" ] + +rm -f 1 2 3 4 diff --git a/testsuite/dwz.tests/hardlink.sh b/testsuite/dwz.tests/hardlink.sh index b70722c..d928989 100644 --- a/testsuite/dwz.tests/hardlink.sh +++ b/testsuite/dwz.tests/hardlink.sh @@ -6,8 +6,6 @@ dwz -h 1 2 smaller-than.sh 1 ../hello smaller-than.sh 2 ../hello -hl="$(find -samefile 1 | sort)" -hl="$(echo $hl)" -[ "$hl" = "./1 ./2" ] +hardlinks-p.sh 1 2 rm -f 1 2 diff --git a/testsuite/scripts/hardlinks-p.sh b/testsuite/scripts/hardlinks-p.sh new file mode 100755 index 0000000..a9a3020 --- /dev/null +++ b/testsuite/scripts/hardlinks-p.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +hardlinks=$(find -samefile "$1") + +for f in "$@"; do + found=false + for hl in $hardlinks; do + if [ "$hl" = "./$f" ]; then + found=true + break + fi + done + if ! $found; then + exit 1 + fi +done