diff options
author | Loïc Hoguin <[email protected]> | 2020-06-08 15:46:42 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2020-06-18 15:06:51 +0200 |
commit | 39828681c7dae5c96e8d6ccf6411802a9b1fb470 (patch) | |
tree | c2dacd1dbbffc6207933f4523534e5eb261cb523 /erlang.mk | |
parent | 9d16b30eefa47b6e8a477238319d9223f4438c40 (diff) | |
download | ranch-39828681c7dae5c96e8d6ccf6411802a9b1fb470.tar.gz ranch-39828681c7dae5c96e8d6ccf6411802a9b1fb470.tar.bz2 ranch-39828681c7dae5c96e8d6ccf6411802a9b1fb470.zip |
Add two Concuerror tests
The tests are starting and stopping a Ranch listener,
and starting a Ranch listener then immediately call
ranch:info/1.
Diffstat (limited to 'erlang.mk')
-rw-r--r-- | erlang.mk | 72 |
1 files changed, 70 insertions, 2 deletions
@@ -17,7 +17,7 @@ ERLANG_MK_FILENAME := $(realpath $(lastword $(MAKEFILE_LIST))) export ERLANG_MK_FILENAME -ERLANG_MK_VERSION = 89f2eca +ERLANG_MK_VERSION = 2020.03.05-18-g4ad50cd ERLANG_MK_WITHOUT = # Make 3.81 and 3.82 are deprecated. @@ -4834,7 +4834,7 @@ define dep_autopatch_rebar.erl Write("\npre-app::\n\t@$$\(MAKE) --no-print-directory -f c_src/Makefile.erlang.mk\n"), PortSpecWrite(io_lib:format("ERL_CFLAGS ?= -finline-functions -Wall -fPIC -I \\"~s/erts-~s/include\\" -I \\"~s\\"\n", [code:root_dir(), erlang:system_info(version), code:lib_dir(erl_interface, include)])), - PortSpecWrite(io_lib:format("ERL_LDFLAGS ?= -L \\"~s\\" -lerl_interface -lei\n", + PortSpecWrite(io_lib:format("ERL_LDFLAGS ?= -L \\"~s\\" -lei\n", [code:lib_dir(erl_interface, lib)])), [PortSpecWrite(["\n", E, "\n"]) || E <- OsEnv], FilterEnv = fun(Env) -> @@ -6541,6 +6541,74 @@ help:: endif +# Copyright (c) 2020, Loïc Hoguin <[email protected]> +# This file is part of erlang.mk and subject to the terms of the ISC License. + +ifdef CONCUERROR_TESTS + +.PHONY: concuerror distclean-concuerror + +# Configuration + +CONCUERROR_LOGS_DIR ?= $(CURDIR)/logs +CONCUERROR_OPTS ?= + +# Core targets. + +check:: concuerror + +ifndef KEEP_LOGS +distclean:: distclean-concuerror +endif + +# Plugin-specific targets. + +$(ERLANG_MK_TMP)/Concuerror/bin/concuerror: | $(ERLANG_MK_TMP) + $(verbose) git clone https://github.com/parapluu/Concuerror $(ERLANG_MK_TMP)/Concuerror + $(verbose) make -C $(ERLANG_MK_TMP)/Concuerror + +$(CONCUERROR_LOGS_DIR): + $(verbose) mkdir -p $(CONCUERROR_LOGS_DIR) + +define concuerror_html_report +<!DOCTYPE html> +<html lang="en"> +<head> +<meta charset="utf-8"> +<title>Concuerror HTML report</title> +</head> +<body> +<h1>Concuerror HTML report</h1> +<p>Generated on $(concuerror_date)</p> +<ul> +$(foreach t,$(concuerror_targets),<li><a href="$(t).txt">$(t)</a></li>) +</ul> +</body> +</html> +endef + +concuerror: $(addprefix concuerror-,$(subst :,-,$(CONCUERROR_TESTS))) + $(eval concuerror_date := $(shell date)) + $(eval concuerror_targets := $^) + $(verbose) $(call core_render,concuerror_html_report,$(CONCUERROR_LOGS_DIR)/concuerror.html) + +define concuerror_target +.PHONY: concuerror-$1-$2 + +concuerror-$1-$2: test-build | $(ERLANG_MK_TMP)/Concuerror/bin/concuerror $(CONCUERROR_LOGS_DIR) + $(ERLANG_MK_TMP)/Concuerror/bin/concuerror \ + --pa $(CURDIR)/ebin --pa $(TEST_DIR) \ + -o $(CONCUERROR_LOGS_DIR)/concuerror-$1-$2.txt \ + $$(CONCUERROR_OPTS) -m $1 -t $2 +endef + +$(foreach test,$(CONCUERROR_TESTS),$(eval $(call concuerror_target,$(firstword $(subst :, ,$(test))),$(lastword $(subst :, ,$(test)))))) + +distclean-concuerror: + $(gen_verbose) rm -rf $(CONCUERROR_LOGS_DIR) + +endif + # Copyright (c) 2013-2016, Loïc Hoguin <[email protected]> # This file is part of erlang.mk and subject to the terms of the ISC License. |