diff options
-rw-r--r-- | .github/workflows/ci.yaml | 122 | ||||
-rw-r--r-- | core/deps.mk | 8 | ||||
-rw-r--r-- | core/elixir.mk | 17 | ||||
-rw-r--r-- | test/core_app.mk | 16 | ||||
-rw-r--r-- | test/core_compat.mk | 4 | ||||
-rw-r--r-- | test/core_deps.mk | 36 | ||||
-rw-r--r-- | test/core_elixir.mk | 51 | ||||
-rw-r--r-- | test/core_plugins.mk | 10 | ||||
-rw-r--r-- | test/core_query.mk | 2 | ||||
-rw-r--r-- | test/plugin_eunit.mk | 2 | ||||
-rw-r--r-- | test/plugin_hex.mk | 2 |
11 files changed, 218 insertions, 52 deletions
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0ff2e4d..e51ef0b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -104,12 +104,17 @@ jobs: - name: Run tests (Linux) if: matrix.os == 'ubuntu-latest' - run: make check c=${{ matrix.suite }} -j4 -k ${{ matrix.extra }} + run: | + erl -sname init_cookie -run erlang halt + make check c=${{ matrix.suite }} -j4 -k ${{ matrix.extra }} - name: Run tests (Windows) if: matrix.os == 'windows-latest' shell: msys2 {0} - run: PATH=$INSTALL_DIR_FOR_OTP/bin:$PATH make check c=${{ matrix.suite }} -j4 -k ${{ matrix.extra }} + run: | + export PATH=$INSTALL_DIR_FOR_OTP/bin:$PATH + erl -sname init_cookie -run erlang halt + make check c=${{ matrix.suite }} -j4 -k ${{ matrix.extra }} - name: Upload artifacts if: failure() @@ -119,6 +124,36 @@ jobs: path: | test/test_*/ + check-asdf-elixir: + runs-on: ubuntu-latest + steps: + + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Erlang/OTP + uses: erlef/setup-beam@v1 + with: + otp-version: 27 + version-type: loose + + - name: Install asdf along with Elixir + run: | + wget https://github.com/asdf-vm/asdf/releases/download/v0.18.0/asdf-v0.18.0-linux-amd64.tar.gz + tar xf asdf-v*-linux-amd64.tar.gz + ./asdf plugin add elixir + ./asdf install elixir 1.18.4-otp-27 + ./asdf set elixir 1.18.4-otp-27 + + - name: Install libsodium + run: sudo apt-get -y install libsodium-dev + + - name: Run tests + run: | + export PATH=$PWD:/home/runner/.asdf/shims:$PATH + erl -sname init_cookie -run erlang halt + make check c=core-elixir -j4 -k + check-hex: strategy: fail-fast: false @@ -178,12 +213,17 @@ jobs: - name: Run tests (Linux) if: matrix.os == 'ubuntu-latest' - run: make check c=hex -j4 -k ${{ matrix.extra }} + run: | + erl -sname init_cookie -run erlang halt + make check c=hex -j4 -k ${{ matrix.extra }} - name: Run tests (Windows) if: matrix.os == 'windows-latest' shell: msys2 {0} - run: PATH=$INSTALL_DIR_FOR_OTP/bin:$PATH make check c=hex -j4 -k ${{ matrix.extra }} + run: | + export PATH=$INSTALL_DIR_FOR_OTP/bin:$PATH + erl -sname init_cookie -run erlang halt + make check c=hex -j4 -k ${{ matrix.extra }} - name: Upload artifacts if: failure() @@ -332,3 +372,77 @@ jobs: - name: Check templates run: make check-templates + + check-in-vm: + strategy: + fail-fast: false + matrix: + os: + - freebsd + suite: + - core-app + - core-apps + - core-autopatch + - core-compat + # Trick GH runners into picking this slower job early. + - ACME=1 c=core-deps + - core-elixir + - core-makedep + - core-misc + - core-plugins + - core-query + - core-upgrade + - asciidoc + - bootstrap + - concuerror + - cover + - c-src + - ct + - dialyzer SET=1 + - dialyzer SET=2 + - dialyzer SET=3 + - dialyzer SET=4 + - edoc + - erlydtl + - escript + - eunit + - proper + - protobuffs + # Trick GH runners into picking this slower job early. + - ACME=1 c=relx + - shell + - sphinx + - triq + - xref + # Don't run tests with CACHE_DEPS or LEGACY. Running them on Linux is + # good enough. + # extra: ['', 'CACHE_DEPS=1', 'LEGACY=1'] + runs-on: ubuntu-latest + steps: + + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Run tests (FreeBSD) + uses: cross-platform-actions/[email protected] + timeout-minutes: 60 + with: + operating_system: ${{ matrix.os }} + version: '14.3' + run: | + sudo pkg update + sudo pkg upgrade -y + sudo pkg install -y erlang elixir bash ca_root_nss gmake git libsodium perl5 7-zip + + git config --global safe.directory '*' + erl -sname init_cookie -run erlang halt + + gmake check c=${{ matrix.suite }} -j4 USE_NODETOOL=1 + + - name: Upload artifacts + if: failure() + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.os }} ${{ matrix.suite }} + path: | + test/test_*/ diff --git a/core/deps.mk b/core/deps.mk index 8b158b7..da7f7c4 100644 --- a/core/deps.mk +++ b/core/deps.mk @@ -142,6 +142,14 @@ export ERL_LIBS export NO_AUTOPATCH +# Elixir. + +# Elixir is automatically enabled in all cases except when +# an Erlang project uses an Elixir dependency. In that case +# $(ELIXIR) must be set explicitly. +ELIXIR ?= $(if $(filter elixir,$(BUILD_DEPS) $(DEPS)),dep,$(if $(EX_FILES),system,disable)) +export ELIXIR + # Verbosity. dep_verbose_0 = @echo " DEP $1 ($(call query_version,$1))"; diff --git a/core/elixir.mk b/core/elixir.mk index 8d1dba9..ece705d 100644 --- a/core/elixir.mk +++ b/core/elixir.mk @@ -2,15 +2,14 @@ # Copyright (c) 2024, Loïc Hoguin <[email protected]> # This file is part of erlang.mk and subject to the terms of the ISC License. -# Elixir is automatically enabled in all cases except when -# an Erlang project uses an Elixir dependency. In that case -# $(ELIXIR) must be set explicitly. -ELIXIR ?= $(if $(filter elixir,$(BUILD_DEPS) $(DEPS)),dep,$(if $(EX_FILES),system,disable)) -export ELIXIR - ifeq ($(ELIXIR),system) # We expect 'elixir' to be on the path. -ELIXIR_LIBS ?= $(dir $(shell readlink -f `which elixir`))/../lib +ELIXIR_BIN ?= $(shell readlink -f `which elixir`) +ELIXIR_LIBS ?= $(abspath $(dir $(ELIXIR_BIN))/../lib) +# Fallback in case 'elixir' is a shim. +ifeq ($(wildcard $(ELIXIR_LIBS)/elixir/),) +ELIXIR_LIBS = $(abspath $(shell elixir -e 'IO.puts(:code.lib_dir(:elixir))')/../) +endif ELIXIR_LIBS := $(ELIXIR_LIBS) export ELIXIR_LIBS ERL_LIBS := $(ERL_LIBS):$(ELIXIR_LIBS) @@ -171,7 +170,8 @@ define dep_autopatch_mix.erl endef define dep_autopatch_mix - sed 's|\(defmodule.*do\)|\1\n try do\n Code.compiler_options(on_undefined_variable: :warn)\n rescue _ -> :ok\n end\n|g' -i $(DEPS_DIR)/$(1)/mix.exs; \ + sed 's|\(defmodule.*do\)|\1\n try do\n Code.compiler_options(on_undefined_variable: :warn)\n rescue _ -> :ok\n end\n|g' $(DEPS_DIR)/$(1)/mix.exs > $(DEPS_DIR)/$(1)/mix.exs.new; \ + mv $(DEPS_DIR)/$(1)/mix.exs.new $(DEPS_DIR)/$(1)/mix.exs; \ $(MAKE) $(DEPS_DIR)/hex_core/ebin/dep_built; \ MIX_ENV="$(if $(MIX_ENV),$(strip $(MIX_ENV)),prod)" \ $(call erlang,$(call dep_autopatch_mix.erl,$1)) @@ -183,6 +183,7 @@ endef define compile_ex.erl {ok, _} = application:ensure_all_started(elixir), {ok, _} = application:ensure_all_started(mix), + $(foreach dep,$(LOCAL_DEPS),_ = application:load($(dep)),) ModCode = list_to_atom("Elixir.Code"), ModCode:put_compiler_option(ignore_module_conflict, true), ModComp = list_to_atom("Elixir.Kernel.ParallelCompiler"), diff --git a/test/core_app.mk b/test/core_app.mk index 7c9c046..3eaf3bb 100644 --- a/test/core_app.mk +++ b/test/core_app.mk @@ -235,7 +235,7 @@ core-app-auto-git-id: init $i "Make it a git repository" $t cd $(APP) && \ - git init -q && \ + git init -q -b master && \ git config user.email "[email protected]" && \ git config user.name "test suite" && \ git add . && \ @@ -1315,7 +1315,7 @@ core-app-pt: init "-compile({parse_transform, my_pt})." > $(APP)/src/my_user.erl $i "Build the application; confirm the parse_transform is used" - $t $(MAKE) -C $(APP) | grep "Running my_pt parse_transform." + $t $(MAKE) -C $(APP) 2>&1 | grep "Running my_pt parse_transform." $i "Check that the application was compiled correctly" $t $(ERL) -pa $(APP)/ebin/ -eval " \ @@ -1355,7 +1355,7 @@ core-app-pt-erlc-opts: init $t echo "ERLC_OPTS += +'{parse_transform, my_pt}'" >> $(APP)/Makefile $i "Build the application; confirm the parse_transform is used" - $t $(MAKE) -C $(APP) | grep "Running my_pt parse_transform." + $t $(MAKE) -C $(APP) 2>&1 | grep "Running my_pt parse_transform." $i "Check that the application was compiled correctly" $t $(ERL) -pa $(APP)/ebin/ -eval " \ @@ -1495,11 +1495,11 @@ core-app-xrl-include: init $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v $i "Download a .xrl file with numerous includes from Gordon" - $t curl -s -o $(APP)/src/xfl_lexer.xrl https://raw.githubusercontent.com/hypernumbers/hypernumbers/master/lib/formula_engine-1.0/priv/xfl_lexer.xrl - $t curl -s -o $(APP)/src/errvals.hrl https://raw.githubusercontent.com/hypernumbers/hypernumbers/master/lib/hypernumbers-1.0/include/errvals.hrl - $t curl -s -o $(APP)/src/muin_proc_dict.hrl https://raw.githubusercontent.com/hypernumbers/hypernumbers/master/lib/hypernumbers-1.0/include/muin_proc_dict.hrl - $t curl -s -o $(APP)/src/muin_records.hrl https://raw.githubusercontent.com/hypernumbers/hypernumbers/master/lib/hypernumbers-1.0/include/muin_records.hrl - $t curl -s -o $(APP)/src/typechecks.hrl https://raw.githubusercontent.com/hypernumbers/hypernumbers/master/lib/hypernumbers-1.0/include/typechecks.hrl + $t curl -s -o $(APP)/src/xfl_lexer.xrl https://raw.githubusercontent.com/essen/hypernumbers/master/lib/formula_engine-1.0/priv/xfl_lexer.xrl + $t curl -s -o $(APP)/src/errvals.hrl https://raw.githubusercontent.com/essen/hypernumbers/master/lib/hypernumbers-1.0/include/errvals.hrl + $t curl -s -o $(APP)/src/muin_proc_dict.hrl https://raw.githubusercontent.com/essen/hypernumbers/master/lib/hypernumbers-1.0/include/muin_proc_dict.hrl + $t curl -s -o $(APP)/src/muin_records.hrl https://raw.githubusercontent.com/essen/hypernumbers/master/lib/hypernumbers-1.0/include/muin_records.hrl + $t curl -s -o $(APP)/src/typechecks.hrl https://raw.githubusercontent.com/essen/hypernumbers/master/lib/hypernumbers-1.0/include/typechecks.hrl $i "Generate unrelated .erl files" $t echo "-module(boy)." > $(APP)/src/boy.erl diff --git a/test/core_compat.mk b/test/core_compat.mk index c8c570d..0e5a89e 100644 --- a/test/core_compat.mk +++ b/test/core_compat.mk @@ -163,7 +163,7 @@ core-compat-rebar-deps-git-tag: init $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v $i "Add Cowboy as a dependency" - $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowboy\ndep_cowboy = git https://github.com/ninenines/cowboy 2.9.0\n"}' $(APP)/Makefile + $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowboy\ndep_cowboy = git https://github.com/ninenines/cowboy 2.13.0\n"}' $(APP)/Makefile $i "Run 'make rebar.config'" $t $(MAKE) -C $(APP) rebar.config $v @@ -174,7 +174,7 @@ core-compat-rebar-deps-git-tag: init $i "Check that Cowboy is listed in rebar.config with a tag" $t $(ERL) -eval " \ {ok, C} = file:consult(\"$(APP)/rebar.config\"), \ - {_, [{cowboy, _, {git, _, {tag, \"2.9.0\"}}}]} = lists:keyfind(deps, 1, C), \ + {_, [{cowboy, _, {git, _, {tag, \"2.13.0\"}}}]} = lists:keyfind(deps, 1, C), \ halt()" $i "Distclean the application" diff --git a/test/core_deps.mk b/test/core_deps.mk index dd052e5..02eff53 100644 --- a/test/core_deps.mk +++ b/test/core_deps.mk @@ -161,8 +161,8 @@ core-deps-cache-git-reuse: init $t cp ../erlang.mk $(APP)_2/ $t $(MAKE) -C $(APP)_2 -f erlang.mk bootstrap-lib $v - $i "Add Cowlib 2.0.0 to the list of dependencies" - $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowlib\ndep_cowlib = git \$$(pkg_cowlib_repo) 2.0.0\n"}' $(APP)_2/Makefile + $i "Add Cowlib 2.15.0 to the list of dependencies" + $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowlib\ndep_cowlib = git \$$(pkg_cowlib_repo) 2.15.0\n"}' $(APP)_2/Makefile $i "Add CACHE_DEPS = 1 to the Makefile" $t perl -ni.bak -e 'print;if ($$.==1) {print "CACHE_DEPS = 1\n"}' $(APP)_2/Makefile @@ -182,8 +182,8 @@ core-deps-cache-git-reuse: init $i "Check that $(APP)_1 cloned Cowlib 1.0.0" $t test "$$(cat $(APP)_1/deps/cowlib/.git/HEAD)" = "d544a494af4dbc810fc9c15eaf5cc050cced1501" - $i "Check that $(APP)_2 cloned Cowlib 2.0.0" - $t test "$$(cat $(APP)_2/deps/cowlib/.git/HEAD)" = "bd37be4d3b065600c3b76b492535e76e5d413fc1" + $i "Check that $(APP)_2 cloned Cowlib 2.15.0" + $t test "$$(cat $(APP)_2/deps/cowlib/.git/HEAD)" = "f8d0ad7f19b5dddd33cbfb089ebd2e2be2a81a5d" core-deps-cache-hex: init @@ -624,7 +624,7 @@ core-deps-fetch-git-subfolder: init # Create an empty file so src/ gets committed. $t touch $(APP)/git_repo/my_dep/src/README $t cd $(APP)/git_repo && \ - git init -q && \ + git init -q -b master && \ git config user.email "[email protected]" && \ git config user.name "test suite" && \ git add . && \ @@ -665,7 +665,7 @@ core-deps-fetch-git-submodule: init # Create an empty file so src/ gets committed. $t touch $(APP)/my_dep/src/README $t cd $(APP)/my_dep && \ - git init -q && \ + git init -q -b master && \ git config user.email "[email protected]" && \ git config user.name "test suite" && \ git add . && \ @@ -674,7 +674,7 @@ core-deps-fetch-git-submodule: init $i "Add the submodule to my_dep" $t mkdir $(APP)/deps $t cd $(APP) && \ - git init -q && \ + git init -q -b master && \ git -c protocol.file.allow=always submodule -q add file://$(abspath $(APP)/my_dep) deps/my_dep && \ git config user.email "[email protected]" && \ git config user.name "test suite" && \ @@ -870,7 +870,7 @@ define add_dep_and_subdep $i "Create a Git repository for $(APP)_$(1)subdep" $t (cd $(APP)_$(1)subdep && \ - git init -q && \ + git init -q -b master && \ git config user.name "Testsuite" && \ git config user.email "[email protected]" && \ git add . && \ @@ -889,7 +889,7 @@ define add_dep_and_subdep $i "Create a Git repository for $(APP)_$(1)dep" $t (cd $(APP)_$(1)dep && \ - git init -q && \ + git init -q -b master && \ git config user.name "Testsuite" && \ git config user.email "[email protected]" && \ git add . && \ @@ -928,7 +928,7 @@ dep_shelldep = git file://$(abspath $(APP)_shelldep) master\ $i "Create a Git repository for $(APP)" $t (cd $(APP) && \ - git init -q && \ + git init -q -b master && \ git config user.name "Testsuite" && \ git config user.email "[email protected]" && \ git add . && \ @@ -1033,7 +1033,7 @@ dep_dep = git file://$(abspath $(APP)_dep) master\ $i "Create a Git repository for $(APP)" $t (cd $(APP) && \ - git init -q && \ + git init -q -b master && \ git config user.name "Testsuite" && \ git config user.email "[email protected]" && \ git add . && \ @@ -1079,7 +1079,7 @@ dep_dep = git file://$(abspath $(APP)_dep) master\ $i "Create a Git repository for $(APP)" $t (cd $(APP) && \ - git init -q && \ + git init -q -b master && \ git config user.name "Testsuite" && \ git config user.email "[email protected]" && \ git add . && \ @@ -1264,8 +1264,8 @@ core-deps-order-first: init $t cp ../erlang.mk $(APP)/my_dep/ $t $(MAKE) -C $(APP)/my_dep/ -f erlang.mk bootstrap-lib $v - $i "Add Cowlib 2.0.0 to the list of dependencies for my_dep" - $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowlib\ndep_cowlib = git https://github.com/ninenines/cowlib 2.0.0\n"}' $(APP)/my_dep/Makefile + $i "Add Cowlib 2.15.0 to the list of dependencies for my_dep" + $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowlib\ndep_cowlib = git https://github.com/ninenines/cowlib 2.15.0\n"}' $(APP)/my_dep/Makefile ifdef LEGACY $i "Add Cowboy and my_dep to the applications key in the .app.src file" @@ -1286,7 +1286,7 @@ endif [ok = application:load(App) || App <- [$(APP), cowboy, cowlib, my_dep, ranch]], \ {ok, Deps} = application:get_key($(APP), applications), \ true = lists:member(cowboy, Deps), \ - {ok, \"2.0.0\"} = application:get_key(cowlib, vsn), \ + {ok, \"2.15.0\"} = application:get_key(cowlib, vsn), \ halt()" # A higher-level dependency always wins. @@ -1297,8 +1297,8 @@ core-deps-order-top: init $t cp ../erlang.mk $(APP)/ $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v - $i "Add Cowboy package and Cowlib 2.0.0 to the list of dependencies" - $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowboy cowlib\ndep_cowlib = git https://github.com/ninenines/cowlib 2.0.0\n"}' $(APP)/Makefile + $i "Add Cowboy package and Cowlib 2.15.0 to the list of dependencies" + $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowboy cowlib\ndep_cowlib = git https://github.com/ninenines/cowlib 2.15.0\n"}' $(APP)/Makefile ifdef LEGACY $i "Add Cowboy to the applications key in the .app.src file" @@ -1318,7 +1318,7 @@ endif [ok = application:load(App) || App <- [$(APP), cowboy, cowlib, ranch]], \ {ok, Deps} = application:get_key($(APP), applications), \ true = lists:member(cowboy, Deps), \ - {ok, \"2.0.0\"} = application:get_key(cowlib, vsn), \ + {ok, \"2.15.0\"} = application:get_key(cowlib, vsn), \ halt()" ifndef LEGACY 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 " \ diff --git a/test/core_plugins.mk b/test/core_plugins.mk index 8544945..76e2899 100644 --- a/test/core_plugins.mk +++ b/test/core_plugins.mk @@ -23,7 +23,7 @@ core-plugins-all: init # We check that overriding THIS doesn't cause an error. $t echo "THIS :=" >> $(APP)/plugin_dep/plugins.mk $t cd $(APP)/plugin_dep && \ - git init -q && \ + git init -q -b master && \ git config user.email "[email protected]" && \ git config user.name "test suite" && \ git add . && \ @@ -168,7 +168,7 @@ core-plugins-one: init # We check that overriding THIS doesn't cause an error. $t echo "THIS :=" >> $(APP)/plugin_dep/plugins.mk $t cd $(APP)/plugin_dep && \ - git init -q && \ + git init -q -b master && \ git config user.email "[email protected]" && \ git config user.name "test suite" && \ git add . && \ @@ -197,7 +197,7 @@ core-plugins-templates: init "-module(template_name)." \ "endef" > $(APP)/plugin_dep/plugins.mk $t cd $(APP)/plugin_dep && \ - git init -q && \ + git init -q -b master && \ git config user.email "[email protected]" && \ git config user.name "test suite" && \ git add . && \ @@ -238,7 +238,7 @@ core-plugins-templates-apps-only: init "-module(test_mk)." \ "endef" > $(APP)/plugin_dep/plugins.mk $t cd $(APP)/plugin_dep && \ - git init -q && \ + git init -q -b master && \ git config user.email "[email protected]" && \ git config user.name "test suite" && \ git add . && \ @@ -276,7 +276,7 @@ core-plugins-templates-file: init $t echo "THIS := \$$(dir \$$(realpath \$$(lastword \$$(MAKEFILE_LIST))))" > $(APP)/plugin_dep/plugins.mk $t printf "%s\n" "tpl_test_mk = \$$(file < \$$(THIS)/templates/test_mk.erl)" >> $(APP)/plugin_dep/plugins.mk $t cd $(APP)/plugin_dep && \ - git init -q && \ + git init -q -b master && \ git config user.email "[email protected]" && \ git config user.name "test suite" && \ git add . && \ diff --git a/test/core_query.mk b/test/core_query.mk index 394652a..3dc7a24 100644 --- a/test/core_query.mk +++ b/test/core_query.mk @@ -154,7 +154,7 @@ endif "farwest: cowlib git https://github.com/ninenines/cowlib master" \ "farwest: cowboy git https://github.com/ninenines/cowboy master" \ "farwest: gun git https://github.com/ninenines/gun master" \ - "gun: cowlib git https://github.com/ninenines/cowlib master" \ + "gun: cowlib git https://github.com/ninenines/cowlib 2.15.0" \ > $(APP)/expected-deps.txt $t cmp $(APP)/expected-deps.txt $(APP)/.erlang.mk/query-deps.log diff --git a/test/plugin_eunit.mk b/test/plugin_eunit.mk index bd1f0e0..532f699 100644 --- a/test/plugin_eunit.mk +++ b/test/plugin_eunit.mk @@ -275,7 +275,7 @@ eunit-erl-opts: init "-endif." > $(APP)/src/$(APP).erl $i "Check that EUnit uses EUNIT_ERL_OPTS" - $t $(MAKE) -C $(APP) eunit | grep -c "hello" | grep -q 1 + $t $(MAKE) -C $(APP) eunit | grep -c "^hello" | grep -q 1 eunit-fun: init diff --git a/test/plugin_hex.mk b/test/plugin_hex.mk index 27060b6..26d3f94 100644 --- a/test/plugin_hex.mk +++ b/test/plugin_hex.mk @@ -10,7 +10,7 @@ hex_TARGETS = $(call list_targets,hex) hex: $(hex_TARGETS) -ifeq ($(shell netcat -z localhost 4000 && echo ok),ok) +ifeq ($(shell nc -z localhost 4000 && echo ok),ok) hex-user-create: init $i "Bootstrap a new OTP application named $(APP)" |