From d72f07d1270badb3dd8b2267597f5416e9462780 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Fri, 12 May 2023 14:34:44 +0200 Subject: Add tests for Relx' {git, short} && {git, long} --- test/plugin_relx.mk | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/plugin_relx.mk b/test/plugin_relx.mk index 554b292..15a54b8 100644 --- a/test/plugin_relx.mk +++ b/test/plugin_relx.mk @@ -332,7 +332,7 @@ relx-tar: init $i "Check that tarball exists" $t test -f $(APP)/_rel/$(APP)_release/$(APP)_release-1.tar.gz -relx-vsn: init +relx-vsn-cmd: init $i "Bootstrap a new release named $(APP)" $t mkdir $(APP)/ @@ -348,3 +348,37 @@ relx-vsn: init $i "Check that the correct release exists" $t ! test -d $(APP)/_rel/$(APP)_release/releases/1 $t test -d $(APP)/_rel/$(APP)_release/releases/2 + +relx-vsn-git-long: init + + $i "Bootstrap a new release named $(APP)" + $t mkdir $(APP)/ + $t cp ../erlang.mk $(APP)/ + $t $(MAKE) -C $(APP) -f erlang.mk bootstrap bootstrap-rel $v + + $i "Replace the vsn" + $t sed -i.bak s/"\"1\""/"{git, long}"/ $(APP)/relx.config + + $i "Build the release" + $t $(MAKE) -C $(APP) $v + + $i "Check that the correct release exists" + $t ! test -d $(APP)/_rel/$(APP)_release/releases/1 + $t test -d $(APP)/_rel/$(APP)_release/releases/$(shell git rev-parse HEAD) + +relx-vsn-git-short: init + + $i "Bootstrap a new release named $(APP)" + $t mkdir $(APP)/ + $t cp ../erlang.mk $(APP)/ + $t $(MAKE) -C $(APP) -f erlang.mk bootstrap bootstrap-rel $v + + $i "Replace the vsn" + $t sed -i.bak s/"\"1\""/"{git, short}"/ $(APP)/relx.config + + $i "Build the release" + $t $(MAKE) -C $(APP) $v + + $i "Check that the correct release exists" + $t ! test -d $(APP)/_rel/$(APP)_release/releases/1 + $t test -d $(APP)/_rel/$(APP)_release/releases/$(shell git rev-parse --short HEAD) -- cgit v1.2.3