diff options
author | Loïc Hoguin <[email protected]> | 2018-05-14 13:55:30 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2018-05-14 13:55:30 +0200 |
commit | e344a3027b7cd5d6510cda8c9d80527de11e24f4 (patch) | |
tree | 872d5c2b4fe50385acfd889c6e9d2cde6fab289c /plugins | |
parent | cbcb57ad25e63a8ff7952121b72458e5b2d04355 (diff) | |
download | erlang.mk-e344a3027b7cd5d6510cda8c9d80527de11e24f4.tar.gz erlang.mk-e344a3027b7cd5d6510cda8c9d80527de11e24f4.tar.bz2 erlang.mk-e344a3027b7cd5d6510cda8c9d80527de11e24f4.zip |
Don't run cover when there's no ebin files in the directory
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/eunit.mk | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/plugins/eunit.mk b/plugins/eunit.mk index af614f6..6ef0778 100644 --- a/plugins/eunit.mk +++ b/plugins/eunit.mk @@ -21,20 +21,25 @@ help:: # Plugin-specific targets. define eunit.erl - case "$(COVER)" of - "" -> ok; + Enabled = case "$(COVER)" of + "" -> false; _ -> - case cover:compile_beam_directory("ebin") of - {error, _} -> halt(1); - _ -> ok + case filelib:is_dir("ebin") of + false -> false; + true -> + case cover:compile_beam_directory("ebin") of + {error, _} -> halt(1); + _ -> true + end end end, case eunit:test($1, [$(EUNIT_OPTS)]) of ok -> ok; error -> halt(2) end, - case "$(COVER)" of - "" -> ok; + case {Enabled, "$(COVER)"} of + {false, _} -> ok; + {_, ""} -> ok; _ -> cover:export("$(COVER_DATA_DIR)/eunit.coverdata") end, |