diff options
author | Roger Lipscombe <[email protected]> | 2018-06-05 11:56:47 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2018-11-23 18:03:23 +0100 |
commit | ff8ddc2d11a8499b2bf5c4b89c5d97ad2173fd47 (patch) | |
tree | 9c718fe77a460bbf868d885c91c75362d8328e72 /test | |
parent | b53cdec30573ebad5b1c655c99d803c6adee2bcc (diff) | |
download | erlang.mk-ff8ddc2d11a8499b2bf5c4b89c5d97ad2173fd47.tar.gz erlang.mk-ff8ddc2d11a8499b2bf5c4b89c5d97ad2173fd47.tar.bz2 erlang.mk-ff8ddc2d11a8499b2bf5c4b89c5d97ad2173fd47.zip |
Add eunit test with apps where one include_lib another
Diffstat (limited to 'test')
-rw-r--r-- | test/plugin_eunit.mk | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/test/plugin_eunit.mk b/test/plugin_eunit.mk index b9947a0..05aebae 100644 --- a/test/plugin_eunit.mk +++ b/test/plugin_eunit.mk @@ -43,6 +43,45 @@ eunit-all: build clean $i "Check that EUnit errors out" $t ! $(MAKE) -C $(APP) eunit $v +eunit-apps-include-lib: build clean + + $i "Bootstrap a new OTP library named $(APP)" + $t mkdir $(APP)/ + $t cp ../erlang.mk $(APP)/ + $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v + + $i "Create new libraries the_app and test_helpers" + $t $(MAKE) -C $(APP) new-lib in=the_app $v + $t $(MAKE) -C $(APP) new-lib in=test_helpers $v + + $i "Generate .erl file" + $t echo '-module(the). -export([thing/0]). thing() -> true.' > $(APP)/apps/the_app/src/the.erl + + $t mkdir -p $(APP)/apps/the_app/test + $i "Generate test .erl file with helper include_lib()" + $t echo '-module(the_test).' > $(APP)/apps/the_app/test/the_test.erl + $t echo '-include_lib("eunit/include/eunit.hrl").' >> $(APP)/apps/the_app/test/the_test.erl + $t echo '-include_lib("test_helpers/include/test_helpers.hrl").' >> $(APP)/apps/the_app/test/the_test.erl + $t echo 'thing_test() -> ?assertEqual(true, the:thing()).' >> $(APP)/apps/the_app/test/the_test.erl + + $t mkdir -p $(APP)/apps/test_helpers/include + $t echo '%% test_helpers' > $(APP)/apps/test_helpers/include/test_helpers.hrl + + $i "Build the application" + $t $(MAKE) -C $(APP) $v + + $i "Run eunit" + $t $(MAKE) -C $(APP) $v + + $i "Distclean the application" + $t $(MAKE) -C $(APP) distclean $v + + $i "Run eunit on a subdirectory" + $t $(MAKE) -C $(APP)/apps/the_app eunit $v + + $i "Distclean the application" + $t $(MAKE) -C $(APP) distclean $v + eunit-apps-only: build clean $i "Create a multi application repository with no root application" |