Skip to content

Commit

Permalink
Add testing to Makefile, remove cover from rebar.config.script
Browse files Browse the repository at this point in the history
For some mysterious reason the coverage analysis completely crashes
when run from make. Will returned when we know why.
  • Loading branch information
rvirding committed Jan 26, 2024
1 parent c1408f6 commit afb0dd5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,22 @@ examples: all
debug:
ERLCFLAGS="+debug_info" make all

###############
### TESTING ###
###############

# XXX for some reason, the first pass of eunit doesn't run the tests?!
eunit:
@rebar3 as test do compile,eunit,eunit

common-test:
@rebar3 as test do compile,ct

ct: common-test

tests:
@rebar3 as test do compile,eunit,eunit,ct

# this protects the intermediate .erl files from make's auto deletion
#.SECONDARY: $(XRL_INTERM) $(YRL_INTERM)

Expand Down
14 changes: 9 additions & 5 deletions rebar.config.script
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ OTPRelease =
%% If OTP <= R16, take the digits.
[N1|Rest];
Rel ->
%% If OTP >= 17.x, erlang:system_info(otp_release) returns
%% just the major version number.
File = filename:join([code:root_dir(),"releases",Rel,"OTP_VERSION"]),
case file:read_file(File) of
{error, _} -> Rel;
Expand Down Expand Up @@ -83,10 +85,12 @@ Conf1 = case lists:keyfind(erl_opts, 1, Conf0) of
Conf0 ++ [{erl_opts,Copts}]
end,

TestConfig = [{cover_enabled, true}, {cover_opts, [verbose]}],
%% TestConfig = [{cover_enabled, true}, {cover_opts, [verbose]}],

Aliases = [{alias, [
{test, [eunit, {ct, "--cover"}, cover]}
]}],
%% Aliases = [{alias, [
%% {test, [eunit, {ct, "--cover"}, cover]}
%% ]}],

Conf1 ++ TestConfig ++ Aliases.
%% Conf1 ++ TestConfig ++ Aliases.

Conf1.

0 comments on commit afb0dd5

Please sign in to comment.