diff options
Diffstat (limited to 'test/core_elixir.mk')
-rw-r--r-- | test/core_elixir.mk | 51 |
1 files changed, 47 insertions, 4 deletions
diff --git a/test/core_elixir.mk b/test/core_elixir.mk index 6a6997b..8c25964 100644 --- a/test/core_elixir.mk +++ b/test/core_elixir.mk @@ -117,6 +117,22 @@ core-elixir-disable-autopatch-fail: init $i "Building the application should fail" $t ! $(MAKE) -C $(APP) $v +core-elixir-disable-autopatch-erlang-mk: init + + $i "Bootstrap a new OTP library named $(APP)" + $t mkdir $(APP)/ + $t cp ../erlang.mk $(APP)/ + $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v + + $i "Add Jose to the list of dependencies" + $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = jose\ndep_jose = git https://github.com/potatosalad/erlang-jose main\n"}' $(APP)/Makefile + + $i "Disable Elixir in the Makefile" + $t perl -ni.bak -e 'print;if ($$.==1) {print "ELIXIR = disable\n"}' $(APP)/Makefile + + $i "Building the application should work as Jose is Erlang.mk-compatible" + $t $(MAKE) -C $(APP) $v + core-elixir-disable-autopatch-make: init $i "Bootstrap a new OTP library named $(APP)" @@ -130,6 +146,16 @@ core-elixir-disable-autopatch-make: init $i "Disable Elixir in the Makefile" $t perl -ni.bak -e 'print;if ($$.==1) {print "ELIXIR = disable\n"}' $(APP)/Makefile + $i "Fetch dependencies to patch 'reloader'" + $t $(MAKE) -C $(APP) fetch-deps $v + +# Patch `reloader` Makefile to be compatible with BSD sed. Its Makefile called +# sed(1) in a way that was only compatible with GNU sed. As a consequence, the +# build failed with BSD sed. + $i "Patch sed(1) use in Makefile" + $t test -f $(APP)/deps/reloader/Makefile + $t perl -pi.bak -e 's/\@sed/\@sed -E/;' -e 'if (/sed/) { s/{/\\{/g; s/}/\\}/g; s/\\s\*//; }' $(APP)/deps/reloader/Makefile + $i "Building the application should work as Reloader contains a proper Makefile" $t $(MAKE) -C $(APP) $v @@ -145,13 +171,26 @@ core-elixir-disable-autopatch-rebar3: init $t cp ../erlang.mk $(APP)/ $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v - $i "Add Jose to the list of dependencies" - $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = jose\ndep_jose = git https://github.com/potatosalad/erlang-jose main\n"}' $(APP)/Makefile + $i "Add OpenTelemetry_API to the list of dependencies" + $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = opentelemetry_api\ndep_opentelemetry_api = hex 1.3.0\n"}' $(APP)/Makefile $i "Disable Elixir in the Makefile" $t perl -ni.bak -e 'print;if ($$.==1) {print "ELIXIR = disable\n"}' $(APP)/Makefile - $i "Building the application should work as Jose is Rebar3-compatible" + $i "Building the application should work as OpenTelemetry_API is Rebar3-compatible" + $t $(MAKE) -C $(APP) $v + +core-elixir-disable-by-default-autopatch-rebar3: init + + $i "Bootstrap a new OTP library named $(APP)" + $t mkdir $(APP)/ + $t cp ../erlang.mk $(APP)/ + $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v + + $i "Add OpenTelemetry_API to the list of dependencies" + $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = opentelemetry_api\ndep_opentelemetry_api = hex 1.3.0\n"}' $(APP)/Makefile + + $i "Building the application should work as OpenTelemetry_API is Rebar3-compatible" $t $(MAKE) -C $(APP) $v core-elixir-from-dep: init @@ -258,8 +297,12 @@ ifdef LEGACY $t perl -ni.bak -e 'print;if ($$.==7) {print "\t\tlibsalty2,\n"}' $(APP)/src/$(APP).app.src endif +# Specify CFLAGS when building the Elixir NIF. On FreeBSD, libsodium's +# `sodium.h` header is installed in `/usr/local/local`. The Makefile already +# adds `/usr/local/include/sodium` to the compiler's `-I` search path, but it +# doesn't cover the FreeBSD case. $i "Build the application" - $t $(MAKE) -C $(APP) $v + $t $(MAKE) -C $(APP) $v CFLAGS=-I/usr/local/include $i "Check that the application was compiled correctly" $t $(ERL) -pa $(APP)/ebin/ -pa $(APP)/deps/*/ebin -pa $(dir $(shell elixir -e 'IO.puts(:code.lib_dir(:elixir))'))/*/ebin -eval " \ |