diff --git a/Makefile b/Makefile index 3b573ce..dd8cc60 100644 --- a/Makefile +++ b/Makefile @@ -7,8 +7,8 @@ BUILD_DEPS = inaka_mk hexer_mk LOCAL_DEPS = xmerl tools compiler syntax_tools common_test inets ssl test_server hipe public_key dialyzer wx dep_xref_runner = hex 0.2.4 -dep_mixer = git https://github.com/inaka/mixer.git 0.1.4 -dep_elvis_core = git https://github.com/inaka/elvis_core.git 0.2.8-2 +dep_mixer = git https://github.com/inaka/mixer.git 0.1.5 +dep_elvis_core = git https://github.com/inaka/elvis_core.git 0.2.11 dep_sync = git https://github.com/rustyio/sync.git 11df81d dep_inaka_mk = git https://github.com/inaka/inaka.mk.git 1.0.0 dep_hexer_mk = git https://github.com/inaka/hexer.mk.git 1.1.0 diff --git a/erlang.mk b/erlang.mk index b58188f..ee0a63a 100644 --- a/erlang.mk +++ b/erlang.mk @@ -16,7 +16,7 @@ ERLANG_MK_FILENAME := $(realpath $(lastword $(MAKEFILE_LIST))) -ERLANG_MK_VERSION = 2.0.0-pre.2-72-g86ddfb5 +ERLANG_MK_VERSION = 2.0.0-pre.2-114-ge629cf3 # Core configuration. @@ -281,7 +281,7 @@ pkg_apns_description = Apple Push Notification Server for Erlang pkg_apns_homepage = http://inaka.github.com/apns4erl pkg_apns_fetch = git pkg_apns_repo = https://github.com/inaka/apns4erl -pkg_apns_commit = 1.0.4 +pkg_apns_commit = master PACKAGES += azdht pkg_azdht_name = azdht @@ -385,7 +385,7 @@ pkg_bitcask_description = because you need another a key/value storage engine pkg_bitcask_homepage = https://github.com/basho/bitcask pkg_bitcask_fetch = git pkg_bitcask_repo = https://github.com/basho/bitcask -pkg_bitcask_commit = master +pkg_bitcask_commit = develop PACKAGES += bitstore pkg_bitstore_name = bitstore @@ -457,7 +457,7 @@ pkg_cake_description = Really simple terminal colorization pkg_cake_homepage = https://github.com/darach/cake-erl pkg_cake_fetch = git pkg_cake_repo = https://github.com/darach/cake-erl -pkg_cake_commit = v0.1.2 +pkg_cake_commit = master PACKAGES += carotene pkg_carotene_name = carotene @@ -793,7 +793,7 @@ pkg_cowboy_description = Small, fast and modular HTTP server. pkg_cowboy_homepage = http://ninenines.eu pkg_cowboy_fetch = git pkg_cowboy_repo = https://github.com/ninenines/cowboy -pkg_cowboy_commit = 1.0.1 +pkg_cowboy_commit = 1.0.4 PACKAGES += cowdb pkg_cowdb_name = cowdb @@ -809,7 +809,7 @@ pkg_cowlib_description = Support library for manipulating Web protocols. pkg_cowlib_homepage = http://ninenines.eu pkg_cowlib_fetch = git pkg_cowlib_repo = https://github.com/ninenines/cowlib -pkg_cowlib_commit = 1.0.1 +pkg_cowlib_commit = 1.0.2 PACKAGES += cpg pkg_cpg_name = cpg @@ -1051,14 +1051,6 @@ pkg_efene_fetch = git pkg_efene_repo = https://github.com/efene/efene pkg_efene_commit = master -PACKAGES += eganglia -pkg_eganglia_name = eganglia -pkg_eganglia_description = Erlang library to interact with Ganglia -pkg_eganglia_homepage = https://github.com/inaka/eganglia -pkg_eganglia_fetch = git -pkg_eganglia_repo = https://github.com/inaka/eganglia -pkg_eganglia_commit = v0.9.1 - PACKAGES += egeoip pkg_egeoip_name = egeoip pkg_egeoip_description = Erlang IP Geolocation module, currently supporting the MaxMind GeoLite City Database. @@ -1073,7 +1065,7 @@ pkg_ehsa_description = Erlang HTTP server basic and digest authentication module pkg_ehsa_homepage = https://bitbucket.org/a12n/ehsa pkg_ehsa_fetch = hg pkg_ehsa_repo = https://bitbucket.org/a12n/ehsa -pkg_ehsa_commit = 2.0.4 +pkg_ehsa_commit = default PACKAGES += ej pkg_ej_name = ej @@ -1513,7 +1505,7 @@ pkg_erwa_description = A WAMP router and client written in Erlang. pkg_erwa_homepage = https://github.com/bwegh/erwa pkg_erwa_fetch = git pkg_erwa_repo = https://github.com/bwegh/erwa -pkg_erwa_commit = 0.1.1 +pkg_erwa_commit = master PACKAGES += espec pkg_espec_name = espec @@ -1617,7 +1609,7 @@ pkg_exometer_description = Basic measurement objects and probe behavior pkg_exometer_homepage = https://github.com/Feuerlabs/exometer pkg_exometer_fetch = git pkg_exometer_repo = https://github.com/Feuerlabs/exometer -pkg_exometer_commit = 1.2 +pkg_exometer_commit = master PACKAGES += exs1024 pkg_exs1024_name = exs1024 @@ -1681,7 +1673,7 @@ pkg_feeder_description = Stream parse RSS and Atom formatted XML feeds. pkg_feeder_homepage = https://github.com/michaelnisi/feeder pkg_feeder_fetch = git pkg_feeder_repo = https://github.com/michaelnisi/feeder -pkg_feeder_commit = v1.4.6 +pkg_feeder_commit = master PACKAGES += fix pkg_fix_name = fix @@ -1843,6 +1835,14 @@ pkg_gen_unix_fetch = git pkg_gen_unix_repo = https://github.com/msantos/gen_unix pkg_gen_unix_commit = master +PACKAGES += geode +pkg_geode_name = geode +pkg_geode_description = geohash/proximity lookup in pure, uncut erlang. +pkg_geode_homepage = https://github.com/bradfordw/geode +pkg_geode_fetch = git +pkg_geode_repo = https://github.com/bradfordw/geode +pkg_geode_commit = master + PACKAGES += getopt pkg_getopt_name = getopt pkg_getopt_description = Module to parse command line arguments using the GNU getopt syntax @@ -2001,7 +2001,7 @@ pkg_ibrowse_description = Erlang HTTP client pkg_ibrowse_homepage = https://github.com/cmullaparthi/ibrowse pkg_ibrowse_fetch = git pkg_ibrowse_repo = https://github.com/cmullaparthi/ibrowse -pkg_ibrowse_commit = v4.1.1 +pkg_ibrowse_commit = master PACKAGES += ierlang pkg_ierlang_name = ierlang @@ -2057,7 +2057,7 @@ pkg_jamdb_sybase_description = Erlang driver for SAP Sybase ASE pkg_jamdb_sybase_homepage = https://github.com/erlangbureau/jamdb_sybase pkg_jamdb_sybase_fetch = git pkg_jamdb_sybase_repo = https://github.com/erlangbureau/jamdb_sybase -pkg_jamdb_sybase_commit = 0.6.0 +pkg_jamdb_sybase_commit = master PACKAGES += jerg pkg_jerg_name = jerg @@ -2070,9 +2070,9 @@ pkg_jerg_commit = master PACKAGES += jesse pkg_jesse_name = jesse pkg_jesse_description = jesse (JSon Schema Erlang) is an implementation of a json schema validator for Erlang. -pkg_jesse_homepage = https://github.com/klarna/jesse +pkg_jesse_homepage = https://github.com/for-GET/jesse pkg_jesse_fetch = git -pkg_jesse_repo = https://github.com/klarna/jesse +pkg_jesse_repo = https://github.com/for-GET/jesse pkg_jesse_commit = master PACKAGES += jiffy @@ -2089,7 +2089,7 @@ pkg_jiffy_v_description = JSON validation utility pkg_jiffy_v_homepage = https://github.com/shizzard/jiffy-v pkg_jiffy_v_fetch = git pkg_jiffy_v_repo = https://github.com/shizzard/jiffy-v -pkg_jiffy_v_commit = 0.3.3 +pkg_jiffy_v_commit = master PACKAGES += jobs pkg_jobs_name = jobs @@ -2097,7 +2097,7 @@ pkg_jobs_description = a Job scheduler for load regulation pkg_jobs_homepage = https://github.com/esl/jobs pkg_jobs_fetch = git pkg_jobs_repo = https://github.com/esl/jobs -pkg_jobs_commit = 0.3 +pkg_jobs_commit = master PACKAGES += joxa pkg_joxa_name = joxa @@ -2123,6 +2123,14 @@ pkg_json_rec_fetch = git pkg_json_rec_repo = https://github.com/justinkirby/json_rec pkg_json_rec_commit = master +PACKAGES += jsone +pkg_jsone_name = jsone +pkg_jsone_description = An Erlang library for encoding, decoding JSON data. +pkg_jsone_homepage = https://github.com/sile/jsone.git +pkg_jsone_fetch = git +pkg_jsone_repo = https://github.com/sile/jsone.git +pkg_jsone_commit = master + PACKAGES += jsonerl pkg_jsonerl_name = jsonerl pkg_jsonerl_description = yet another but slightly different erlang <-> json encoder/decoder @@ -2163,6 +2171,14 @@ pkg_kafka_fetch = git pkg_kafka_repo = https://github.com/wooga/kafka-erlang pkg_kafka_commit = master +PACKAGES += kafka_protocol +pkg_kafka_protocol_name = kafka_protocol +pkg_kafka_protocol_description = Kafka protocol Erlang library +pkg_kafka_protocol_homepage = https://github.com/klarna/kafka_protocol +pkg_kafka_protocol_fetch = git +pkg_kafka_protocol_repo = https://github.com/klarna/kafka_protocol.git +pkg_kafka_protocol_commit = master + PACKAGES += kai pkg_kai_name = kai pkg_kai_description = DHT storage by Takeshi Inoue @@ -2305,7 +2321,7 @@ pkg_lasse_description = SSE handler for Cowboy pkg_lasse_homepage = https://github.com/inaka/lasse pkg_lasse_fetch = git pkg_lasse_repo = https://github.com/inaka/lasse -pkg_lasse_commit = 0.1.0 +pkg_lasse_commit = master PACKAGES += ldap pkg_ldap_name = ldap @@ -2761,7 +2777,7 @@ pkg_octopus_description = Small and flexible pool manager written in Erlang pkg_octopus_homepage = https://github.com/erlangbureau/octopus pkg_octopus_fetch = git pkg_octopus_repo = https://github.com/erlangbureau/octopus -pkg_octopus_commit = 1.0.0 +pkg_octopus_commit = master PACKAGES += of_protocol pkg_of_protocol_name = of_protocol @@ -2833,7 +2849,7 @@ pkg_pegjs_description = An implementation of PEG.js grammar for Erlang. pkg_pegjs_homepage = https://github.com/dmitriid/pegjs pkg_pegjs_fetch = git pkg_pegjs_repo = https://github.com/dmitriid/pegjs -pkg_pegjs_commit = 0.3 +pkg_pegjs_commit = master PACKAGES += percept2 pkg_percept2_name = percept2 @@ -3001,7 +3017,7 @@ pkg_qdate_description = Date, time, and timezone parsing, formatting, and conver pkg_qdate_homepage = https://github.com/choptastic/qdate pkg_qdate_fetch = git pkg_qdate_repo = https://github.com/choptastic/qdate -pkg_qdate_commit = 0.4.0 +pkg_qdate_commit = master PACKAGES += qrcode pkg_qrcode_name = qrcode @@ -3073,7 +3089,7 @@ pkg_ranch_description = Socket acceptor pool for TCP protocols. pkg_ranch_homepage = http://ninenines.eu pkg_ranch_fetch = git pkg_ranch_repo = https://github.com/ninenines/ranch -pkg_ranch_commit = 1.1.0 +pkg_ranch_commit = 1.2.1 PACKAGES += rbeacon pkg_rbeacon_name = rbeacon @@ -3113,7 +3129,7 @@ pkg_recon_description = Collection of functions and scripts to debug Erlang in p pkg_recon_homepage = https://github.com/ferd/recon pkg_recon_fetch = git pkg_recon_repo = https://github.com/ferd/recon -pkg_recon_commit = 2.2.1 +pkg_recon_commit = master PACKAGES += record_info pkg_record_info_name = record_info @@ -3377,7 +3393,7 @@ pkg_shotgun_description = better than just a gun pkg_shotgun_homepage = https://github.com/inaka/shotgun pkg_shotgun_fetch = git pkg_shotgun_repo = https://github.com/inaka/shotgun -pkg_shotgun_commit = 0.1.0 +pkg_shotgun_commit = master PACKAGES += sidejob pkg_sidejob_name = sidejob @@ -3435,6 +3451,14 @@ pkg_skel_fetch = git pkg_skel_repo = https://github.com/ParaPhrase/skel pkg_skel_commit = master +PACKAGES += slack +pkg_slack_name = slack +pkg_slack_description = Minimal slack notification OTP library. +pkg_slack_homepage = https://github.com/DonBranson/slack +pkg_slack_fetch = git +pkg_slack_repo = https://github.com/DonBranson/slack.git +pkg_slack_commit = master + PACKAGES += smother pkg_smother_name = smother pkg_smother_description = Extended code coverage metrics for Erlang. @@ -3761,7 +3785,7 @@ pkg_unicorn_description = Generic configuration server pkg_unicorn_homepage = https://github.com/shizzard/unicorn pkg_unicorn_fetch = git pkg_unicorn_repo = https://github.com/shizzard/unicorn -pkg_unicorn_commit = 0.3.0 +pkg_unicorn_commit = master PACKAGES += unsplit pkg_unsplit_name = unsplit @@ -3777,7 +3801,7 @@ pkg_uuid_description = Erlang UUID Implementation pkg_uuid_homepage = https://github.com/okeuday/uuid pkg_uuid_fetch = git pkg_uuid_repo = https://github.com/okeuday/uuid -pkg_uuid_commit = v1.4.0 +pkg_uuid_commit = master PACKAGES += ux pkg_ux_name = ux @@ -3897,7 +3921,7 @@ pkg_worker_pool_description = a simple erlang worker pool pkg_worker_pool_homepage = https://github.com/inaka/worker_pool pkg_worker_pool_fetch = git pkg_worker_pool_repo = https://github.com/inaka/worker_pool -pkg_worker_pool_commit = 1.0.3 +pkg_worker_pool_commit = master PACKAGES += wrangler pkg_wrangler_name = wrangler @@ -3929,7 +3953,7 @@ pkg_xref_runner_description = Erlang Xref Runner (inspired in rebar xref) pkg_xref_runner_homepage = https://github.com/inaka/xref_runner pkg_xref_runner_fetch = git pkg_xref_runner_repo = https://github.com/inaka/xref_runner -pkg_xref_runner_commit = 0.2.3 +pkg_xref_runner_commit = master PACKAGES += yamerl pkg_yamerl_name = yamerl @@ -3969,7 +3993,7 @@ pkg_zeta_description = HTTP access log parser in Erlang pkg_zeta_homepage = https://github.com/s1n4/zeta pkg_zeta_fetch = git pkg_zeta_repo = https://github.com/s1n4/zeta -pkg_zeta_commit = +pkg_zeta_commit = master PACKAGES += zippers pkg_zippers_name = zippers @@ -4346,9 +4370,9 @@ define dep_autopatch_rebar.erl [] -> ok; _ -> Write("\npre-app::\n\t$$\(MAKE) -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", + 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\\" -lerl_interface -lei\n", [code:lib_dir(erl_interface, lib)])), [PortSpecWrite(["\n", E, "\n"]) || E <- OsEnv], FilterEnv = fun(Env) -> @@ -4638,6 +4662,7 @@ $(foreach p,$(DEP_PLUGINS),\ DTL_FULL_PATH ?= DTL_PATH ?= templates/ DTL_SUFFIX ?= _dtl +DTL_OPTS ?= # Verbosity. @@ -4670,7 +4695,7 @@ define erlydtl_compile.erl re:replace(F2, "/", "_", [{return, list}, global]) end, Module = list_to_atom(string:to_lower(Module0) ++ "$(DTL_SUFFIX)"), - case erlydtl:compile(F, Module, [{out_dir, "ebin/"}, return_errors, {doc_root, "templates"}]) of + case erlydtl:compile(F, Module, [$(DTL_OPTS)] ++ [{out_dir, "ebin/"}, return_errors, {doc_root, "templates"}]) of ok -> ok; {ok, _} -> ok end @@ -4962,13 +4987,13 @@ ifeq ($(wildcard src/$(PROJECT).app.src),) $(app_verbose) printf "$(subst $(newline),\n,$(subst ",\",$(call app_file,$(GITDESCRIBE),$(MODULES))))" \ > ebin/$(PROJECT).app else - $(verbose) if [ -z "$$(grep -E '^[^%]*{\s*modules\s*,' src/$(PROJECT).app.src)" ]; then \ + $(verbose) if [ -z "$$(grep -e '^[^%]*{\s*modules\s*,' src/$(PROJECT).app.src)" ]; then \ echo "Empty modules entry not found in $(PROJECT).app.src. Please consult the erlang.mk README for instructions." >&2; \ exit 1; \ fi $(appsrc_verbose) cat src/$(PROJECT).app.src \ | sed "s/{[[:space:]]*modules[[:space:]]*,[[:space:]]*\[\]}/{modules, \[$(call comma_list,$(MODULES))\]}/" \ - | sed "s/{id,[[:space:]]*\"git\"}/{id, \"$(GITDESCRIBE)\"}/" \ + | sed "s/{id,[[:space:]]*\"git\"}/{id, \"$(subst /,\/,$(GITDESCRIBE))\"}/" \ > ebin/$(PROJECT).app endif @@ -5086,7 +5111,7 @@ endif # We strip out -Werror because we don't want to fail due to # warnings when used as a dependency. -compat_prepare_erlc_opts = $(shell echo "$1" | sed 's/, */,/') +compat_prepare_erlc_opts = $(shell echo "$1" | sed 's/, */,/g') define compat_convert_erlc_opts $(if $(filter-out -Werror,$1),\ @@ -5095,12 +5120,16 @@ $(if $(filter-out -Werror,$1),\ endef define compat_erlc_opts_to_list - [$(call comma_list,$(foreach o,$(call compat_prepare_erlc_opts,$1),$(call compat_convert_erlc_opts,$o)))] +[$(call comma_list,$(foreach o,$(call compat_prepare_erlc_opts,$1),$(call compat_convert_erlc_opts,$o)))] endef define compat_rebar_config -{deps, [$(call comma_list,$(foreach d,$(DEPS),\ - {$(call dep_name,$d),".*",{git,"$(call dep_repo,$d)","$(call dep_commit,$d)"}}))]}. +{deps, [ +$(call comma_list,$(foreach d,$(DEPS),\ + $(if $(filter hex,$(call dep_fetch,$d)),\ + {$(call dep_name,$d)$(comma)"$(call dep_repo,$d)"},\ + {$(call dep_name,$d)$(comma)".*"$(comma){git,"$(call dep_repo,$d)"$(comma)"$(call dep_commit,$d)"}}))) +]}. {erl_opts, $(call compat_erlc_opts_to_list,$(ERLC_OPTS))}. endef @@ -5170,8 +5199,8 @@ help:: " bootstrap Generate a skeleton of an OTP application" \ " bootstrap-lib Generate a skeleton of an OTP library" \ " bootstrap-rel Generate the files needed to build a release" \ - " new-app n=NAME Create a new local OTP application NAME" \ - " new-lib n=NAME Create a new local OTP library NAME" \ + " new-app in=NAME Create a new local OTP application NAME" \ + " new-lib in=NAME Create a new local OTP library NAME" \ " new t=TPL n=NAME Generate a module NAME based on the template TPL" \ " new t=T n=N in=APP Generate a module NAME based on the template TPL in APP" \ " list-templates List available templates" @@ -5331,6 +5360,11 @@ code_change(_OldVsn, State, _Extra) -> {ok, State}. endef +define tpl_module +-module($(n)). +-export([]). +endef + define tpl_cowboy_http -module($(n)). -behaviour(cowboy_http_handler). @@ -5645,6 +5679,7 @@ ifeq ($(PLATFORM),msys2) # We hardcode the compiler used on MSYS2. The default CC=cc does # not produce working code. The "gcc" MSYS2 package also doesn't. CC = /mingw64/bin/gcc + export CC CFLAGS ?= -O3 -std=c99 -finline-functions -Wall -Wmissing-prototypes CXXFLAGS ?= -O3 -finline-functions -Wall else ifeq ($(PLATFORM),darwin) @@ -5946,7 +5981,7 @@ help:: CT_RUN = ct_run \ -no_auto_compile \ -noinput \ - -pa $(CURDIR)/ebin $(DEPS_DIR)/*/ebin $(TEST_DIR) \ + -pa $(CURDIR)/ebin $(DEPS_DIR)/*/ebin $(APPS_DIR)/*/ebin $(TEST_DIR) \ -dir $(TEST_DIR) \ -logdir $(CURDIR)/logs @@ -5955,12 +5990,18 @@ ct: $(if $(IS_APP),,apps-ct) else ct: test-build $(if $(IS_APP),,apps-ct) $(verbose) mkdir -p $(CURDIR)/logs/ - $(gen_verbose) $(CT_RUN) -suite $(addsuffix _SUITE,$(CT_SUITES)) $(CT_OPTS) + $(gen_verbose) $(CT_RUN) -sname ct_$(PROJECT) -suite $(addsuffix _SUITE,$(CT_SUITES)) $(CT_OPTS) endif ifneq ($(ALL_APPS_DIRS),) -apps-ct: - $(verbose) for app in $(ALL_APPS_DIRS); do $(MAKE) -C $$app ct IS_APP=1; done +define ct_app_target +apps-ct-$1: + $(MAKE) -C $1 ct IS_APP=1 +endef + +$(foreach app,$(ALL_APPS_DIRS),$(eval $(call ct_app_target,$(app)))) + +apps-ct: test-build $(addprefix apps-ct-,$(ALL_APPS_DIRS)) endif ifndef t @@ -5977,7 +6018,7 @@ endif define ct_suite_target ct-$(1): test-build $(verbose) mkdir -p $(CURDIR)/logs/ - $(gen_verbose) $(CT_RUN) -suite $(addsuffix _SUITE,$(1)) $(CT_EXTRA) $(CT_OPTS) + $(gen_verbose) $(CT_RUN) -sname ct_$(PROJECT) -suite $(addsuffix _SUITE,$(1)) $(CT_EXTRA) $(CT_OPTS) endef $(foreach test,$(CT_SUITES),$(eval $(call ct_suite_target,$(test)))) @@ -6073,6 +6114,8 @@ distclean-edoc: # Configuration. ESCRIPT_NAME ?= $(PROJECT) +ESCRIPT_FILE ?= $(ESCRIPT_NAME) + ESCRIPT_COMMENT ?= This is an -*- erlang -*- file ESCRIPT_BEAMS ?= "ebin/*", "deps/*/ebin/*" @@ -6118,7 +6161,7 @@ define ESCRIPT_RAW ' ]),'\ ' file:change_mode(Escript, 8#755)'\ 'end,'\ -'Ez("$(ESCRIPT_NAME)"),'\ +'Ez("$(ESCRIPT_FILE)"),'\ 'halt().' endef @@ -6173,7 +6216,7 @@ define eunit.erl halt() endef -EUNIT_ERL_OPTS += -pa $(TEST_DIR) $(DEPS_DIR)/*/ebin $(APPS_DIR)/*/ebin ebin +EUNIT_ERL_OPTS += -pa $(TEST_DIR) $(DEPS_DIR)/*/ebin $(APPS_DIR)/*/ebin $(CURDIR)/ebin ifdef t ifeq (,$(findstring :,$(t))) @@ -6184,8 +6227,9 @@ eunit: test-build $(gen_verbose) $(call erlang,$(call eunit.erl,fun $(t)/0),$(EUNIT_ERL_OPTS)) endif else -EUNIT_EBIN_MODS = $(notdir $(basename $(call core_find,ebin/,*.beam))) -EUNIT_TEST_MODS = $(notdir $(basename $(call core_find,$(TEST_DIR)/,*.beam))) +EUNIT_EBIN_MODS = $(notdir $(basename $(ERL_FILES) $(BEAM_FILES))) +EUNIT_TEST_MODS = $(notdir $(basename $(call core_find,$(TEST_DIR)/,*.erl))) + EUNIT_MODS = $(foreach mod,$(EUNIT_EBIN_MODS) $(filter-out \ $(patsubst %,%_tests,$(EUNIT_EBIN_MODS)),$(EUNIT_TEST_MODS)),'$(mod)') @@ -6476,7 +6520,8 @@ define cover_report.erl true -> N - 1; false -> N end}} || {M, {Y, N}} <- Report], TotalY = lists:sum([Y || {_, {Y, _}} <- Report1]), TotalN = lists:sum([N || {_, {_, N}} <- Report1]), - TotalPerc = round(100 * TotalY / (TotalY + TotalN)), + Perc = fun(Y, N) -> case Y + N of 0 -> 100; S -> round(100 * Y / S) end end, + TotalPerc = Perc(TotalY, TotalN), {ok, F} = file:open("$(COVER_REPORT_DIR)/index.html", [write]), io:format(F, "~n" "~n" @@ -6486,7 +6531,7 @@ define cover_report.erl io:format(F, "~n", []), [io:format(F, "" "~n", - [M, M, round(100 * Y / (Y + N))]) || {M, {Y, N}} <- Report1], + [M, M, Perc(Y, N)]) || {M, {Y, N}} <- Report1], How = "$(subst $(space),$(comma)$(space),$(basename $(COVERDATA)))", Date = "$(shell date -u "+%Y-%m-%dT%H:%M:%SZ")", io:format(F, "
ModuleCoverage
~p~p%
~n"