X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;f=tests%2Fbuild-common;h=2f0cb60d7363db18b8615e4f8f3a07ef78deea51;hb=HEAD;hp=01ed83929ff275ebf4834a45c5bdfa4d44ed2d6c;hpb=b02d595051d9335152142c62a71d4aceab93d25d;p=subdirmk.git diff --git a/tests/build-common b/tests/build-common index 01ed839..2f0cb60 100644 --- a/tests/build-common +++ b/tests/build-common @@ -1,4 +1,23 @@ +# subdirmk - part of the test suite +# Copyright 2019 Mark Wooding +# Copyright 2019 Ian Jackson +# SPDX-License-Identifier: LGPL-2.0-or-later +# There is NO WARRANTY. SUBDIRMK_REGEN_NDEBUG='' export SUBDIRMK_REGEN_NDEBUG +make_copy () { + rm -rf tests/$1/example + mkdir tests/$1/example + + git ls-files -z example \ + | xargs -0 \ + sh -xec 'rsync -R -l "$@" tests/'$1'/' x + + rm tests/$1/example/subdirmk + + git ls-files -z :. :!example \ + | xargs -0 \ + sh -xec 'rsync -R -l "$@" tests/'$1'/example/subdirmk' x +}