Skip to content

Commit 9ff4d39

Browse files
committed
Improve test coverage
Renames test/test_packbeam.erl -> test/packbeam_api_tests.erl to conform to standard eunit naming conventions, with the test module having the same name as the module is test with `_tests` appended to the name. This allows testing individual modules with `rebar3 eunit -m MODULE`. Add packbeam_tests.erl to test the main `packbeam` cli escript. The escript should be assembled in the `test` profile, as is done in the Makefile `etest` target, before eunit tests are run. Signed-off-by: Winford <winford@object.stream>
1 parent fcfd504 commit 9ff4d39

File tree

4 files changed

+584
-1
lines changed

4 files changed

+584
-1
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ doc:
1616
rebar3 as doc ex_doc
1717

1818
etest:
19+
rebar3 as test escriptize
1920
rebar3 as test eunit --cover
2021
rebar3 as test proper --cover
2122
rebar3 as test cover --verbose

rebar.config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@
3232
{profiles, [
3333
{test, [
3434
{erl_opts, [debug_info]},
35+
{extra_src_dirs, ["test"]},
3536
{cover_enabled, true},
37+
{cover_opts, [{verbose, true}]},
3638
{deps, [
3739
{proper, "1.4.0"}
3840
]},
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
%%
1717
%% SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
1818

19-
-module(test_packbeam).
19+
-module(packbeam_api_tests).
2020

2121
-include_lib("proper/include/proper.hrl").
2222
-include_lib("eunit/include/eunit.hrl").

0 commit comments

Comments
 (0)