aboutsummaryrefslogtreecommitdiffstats
path: root/test/core_compat.mk
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2015-09-27 17:10:25 +0200
committerLoïc Hoguin <[email protected]>2015-09-27 17:10:25 +0200
commitfad3d20752edd48e1cb48c667e7f3e2e74a11517 (patch)
tree7e65c526d1823716fd4e153fbadf22b9d986f9fe /test/core_compat.mk
parent0f78319fd528236a0fd7d152870e77248cfc5891 (diff)
downloaderlang.mk-fad3d20752edd48e1cb48c667e7f3e2e74a11517.tar.gz
erlang.mk-fad3d20752edd48e1cb48c667e7f3e2e74a11517.tar.bz2
erlang.mk-fad3d20752edd48e1cb48c667e7f3e2e74a11517.zip
Replace sed -i with perl -ni in tests
This fixes an issue on OSX where the OSX make 3.81 has a bug with multilines single quoted arguments to commands: it strips the backslash and newlines entirely. This makes it impossible to use sed -i properly. Since this is the test suite, we can instead use perl -ni, which can do the same and is available and work fine on all tested platforms.
Diffstat (limited to 'test/core_compat.mk')
-rw-r--r--test/core_compat.mk13
1 files changed, 3 insertions, 10 deletions
diff --git a/test/core_compat.mk b/test/core_compat.mk
index 62dfe93..06d5211 100644
--- a/test/core_compat.mk
+++ b/test/core_compat.mk
@@ -106,10 +106,7 @@ core-compat-rebar-deps: build clean-core-compat-rebar-deps
$t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
$i "Add Cowboy as a dependency"
- $t sed -i.bak '2i\
-DEPS = cowboy\
-dep_cowboy = git https://github.com/ninenines/cowboy 1.0.0\
-' $(APP)/Makefile
+ $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowboy\ndep_cowboy = git https://github.com/ninenines/cowboy 1.0.0\n"}' $(APP)/Makefile
$i "Run 'make rebar.config'"
$t $(MAKE) -C $(APP) rebar.config $v
@@ -141,9 +138,7 @@ core-compat-rebar-deps-pkg: build clean-core-compat-rebar-deps-pkg
$t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
$i "Add Cowboy package as a dependency"
- $t sed -i.bak '2i\
-DEPS = cowboy\
-' $(APP)/Makefile
+ $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowboy\n"}' $(APP)/Makefile
$i "Run 'make rebar.config'"
$t $(MAKE) -C $(APP) rebar.config $v
@@ -228,9 +223,7 @@ core-compat-rebar-pt: build clean-core-compat-rebar-pt
$t echo "-module(girl)." > $(APP)/src/girl.erl
$i "Add lager to the list of dependencies"
- $t sed -i.bak '2i\
-DEPS = lager\
-' $(APP)/Makefile
+ $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = lager\n"}' $(APP)/Makefile
$i "Add the lager_transform parse_transform to ERLC_OPTS"
$t echo "ERLC_OPTS += +'{parse_transform, lager_transform}'" >> $(APP)/Makefile