ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: "Vladimir D. Seleznev" <vseleznv@altlinux.org>
To: devel@lists.altlinux.org
Cc: legion@altlinux.org, "Vladimir D. Seleznev" <vseleznv@altlinux.org>
Subject: [devel] [PATCH 2/3] tests: add test for nodiff directive
Date: Thu, 26 Nov 2020 17:16:35 +0300
Message-ID: <20201126141636.2742206-2-vseleznv@altlinux.org> (raw)
In-Reply-To: <20201126141636.2742206-1-vseleznv@altlinux.org>

Signed-off-by: Vladimir D. Seleznev <vseleznv@altlinux.org>
---
 tests/gear-rules-diff-tag-tree-nodiff.test | 52 ++++++++++++++++++++++
 1 file changed, 52 insertions(+)
 create mode 100644 tests/gear-rules-diff-tag-tree-nodiff.test

diff --git a/tests/gear-rules-diff-tag-tree-nodiff.test b/tests/gear-rules-diff-tag-tree-nodiff.test
new file mode 100644
index 0000000..e22fc4e
--- /dev/null
+++ b/tests/gear-rules-diff-tag-tree-nodiff.test
@@ -0,0 +1,52 @@
+#!/bin/sh -efu
+
+gear_rules_diff_tag_tree_nodiff() # test entry point
+{
+	local spec=file.spec
+	local n=foo
+	local v=1
+	local r=99
+	local src=a/bb/ccc/dddd/src
+	local dst=1/22/333/4444/55555/dst
+	local patch="${dst##*/}-$v-$r.patch${gear_directive#diff}"
+
+	printf 'Name:%s\nVersion:  %s\nRelease:   %s' "$n" "$v" "$r" >"$spec"
+	mkdir -p $src
+	echo one >$src/file
+	echo two >$src/file2
+	git add "$spec" $src/file $src/file2
+	git commit -q -a -m 1
+	git tag -a -m t1 v1
+	git rm -q -f $src/file $src/file2
+	mkdir .gear
+	echo "$gear_directive: v1:$src $dst" > .gear/rules
+	echo "nodiff: file2" >> .gear/rules
+	echo "nodiff: file3" >> .gear/rules
+	mkdir -p $dst
+	echo two >$dst/file
+	echo three >$dst/file3
+	git add .gear/rules $dst/file $dst/file3
+	gear-store-tags -a
+	git commit -q -a -m 2
+
+	finalize_repo
+
+	$GEAR "$GEAR_OUT"
+	check_pkgtar_list "$spec
+./
+./$spec
+./$patch"
+	check_pkgtar_spec "$GEAR_OUT" "$spec"
+	unpack_pkgtar_to .out
+	result="$($decompress_prog ".out/$patch")"
+	assertEquals ' file | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/file b/file
+index 5626abf..f719efd 100644
+--- a/file
++++ b/file
+@@ -1 +1 @@
+-one
++two' "$result"
+}
-- 
2.29.2



  reply	other threads:[~2020-11-26 14:16 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-26 14:16 [devel] [PATCH 1/3] Introduce nodiff directive for gear-rules Vladimir D. Seleznev
2020-11-26 14:16 ` Vladimir D. Seleznev [this message]
2020-11-26 14:16 ` [devel] [PATCH 3/3] tests: check nodiff does not fail if pattern matches no file Vladimir D. Seleznev
2020-11-26 14:49 ` [devel] [PATCH 1/3] Introduce nodiff directive for gear-rules Alexey Gladkov
2020-11-26 14:54   ` Vladimir D. Seleznev
2020-11-26 15:17     ` Alexey Gladkov
2020-11-26 15:20       ` Anton Farygin
2020-11-26 15:51       ` Alexey Gladkov
2020-12-09  2:10         ` Dmitry V. Levin
2020-12-09 10:40           ` Alexey Gladkov
2020-12-09 14:39             ` [devel] gear-rules: allow backslashes to escape any characters Dmitry V. Levin
2020-12-09 14:48               ` Vladimir D. Seleznev
2020-12-09 15:51               ` Alexey Gladkov
2020-12-10 10:31                 ` Dmitry V. Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201126141636.2742206-2-vseleznv@altlinux.org \
    --to=vseleznv@altlinux.org \
    --cc=devel@lists.altlinux.org \
    --cc=legion@altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git