From bf02b66c61d941a60e45520ef77f677dad36557e Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 10 Apr 2019 22:56:22 +0300 Subject: Add --amend and --squash options to bdep-release --- tests/release.testscript | 126 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 125 insertions(+), 1 deletion(-) (limited to 'tests/release.testscript') diff --git a/tests/release.testscript b/tests/release.testscript index 2f63265..1ba4cbc 100644 --- a/tests/release.testscript +++ b/tests/release.testscript @@ -651,6 +651,124 @@ log2 = $gp2 log '--pretty=format:"%d %s"' Create EOO } + + : amend + : + { + test.arguments += --push --amend --no-edit + + +$clone_repos + + +echo '' >+ prj/repositories.manifest + +$gp commit -a -m 'Fix repositories.manifest' + + +echo '' >+ prj/buildfile + +$gp commit -a -m 'Fix buildfile' -m "Add '\n' to the end of the file." + + +echo '' >+ prj/manifest + +$gp add manifest + + : no-squash + : + { + $clone_repos; + + $* 2>>~%EOE%; + %Updated tag 'v0.1.0' \(was \.*\)%d + EOE + + $clone2; + $log2 >>:~%EOO%; + % \(HEAD -> master, tag: v0.1.0, \.*\) Release version 0.1.0\+1%d + Fix repositories.manifest + Release version 0.1.0 + Create + EOO + + $log2 '--pretty=format:%B' >>EOO + Release version 0.1.0+1 + + Fix buildfile + + Add 'n' to the end of the file. + + Fix repositories.manifest + + Release version 0.1.0 + + Create + EOO + } + + : squash + : + { + $clone_repos; + + $* --squash 2 2>>~%EOE%; + %Updated tag 'v0.1.0' \(was \.*\)%d + EOE + + $clone2; + $log2 >>:~%EOO%; + % \(HEAD -> master, tag: v0.1.0, \.*\) Release version 0.1.0\+1%d + Release version 0.1.0 + Create + EOO + + $log2 '--pretty=format:%B' >>EOO + Release version 0.1.0+1 + + Fix buildfile + + Add 'n' to the end of the file. + + Fix repositories.manifest + + Release version 0.1.0 + + Create + EOO + } + + : no-changes-staged + : + { + $clone_repos; + + $gp commit -a -m 'Change manifest'; + + $* 2>>~%EOE%; + %Updated tag 'v0.1.0' \(was \.*\)%d + EOE + + $clone2; + $log2 >>:~%EOO%; + % \(HEAD -> master, tag: v0.1.0, \.*\) Release version 0.1.0\+1%d + Fix buildfile + Fix repositories.manifest + Release version 0.1.0 + Create + EOO + + + $log2 '--pretty=format:%B' >>EOO + Release version 0.1.0+1 + + Change manifest + + Fix buildfile + + Add 'n' to the end of the file. + + Fix repositories.manifest + + Release version 0.1.0 + + Create + EOO + } + } } : open @@ -1016,5 +1134,11 @@ log2 = $gp2 log '--pretty=format:"%d %s"' $* --push --show-push 2>'error: both --push and --show-push specified' != 0; $* --edit --no-commit 2>'error: both --no-commit and --edit specified' != 0; - $* --open-base 1.2.3 --open-beta 2>'error: both --open-beta and --open-base specified' != 0 + $* --open-base 1.2.3 --open-beta 2>'error: both --open-beta and --open-base specified' != 0; + + $* --amend 2>'error: --amend requires --revision' != 0; + $* --squash 1 2>'error: --squash requires --amend' != 0; + $* --revision --amend --squash 0 2>'error: invalid --squash value: 0' != 0; + $* --revision --amend --no-commit 2>'error: both --amend and --no-commit specified' != 0 + } -- cgit v1.1