123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572 |
- # Common Test plugin.
- COVER_TARGETS = $(call list_targets,cover)
- .PHONY: cover $(COVER_TARGETS)
- cover: $(COVER_TARGETS)
- cover-ct: init
- $i "Bootstrap a new OTP application named $(APP)"
- $t mkdir $(APP)/
- $t cp ../erlang.mk $(APP)/
- $t $(MAKE) -C $(APP) -f erlang.mk bootstrap $v
- $i "Generate a Common Test suite"
- $t mkdir $(APP)/test
- $t printf "%s\n" \
- "-module($(APP)_SUITE)." \
- "-export([all/0, ok/1])." \
- "all() -> [ok]." \
- "ok(_) -> application:start($(APP))." > $(APP)/test/$(APP)_SUITE.erl
- $i "Run Common Test with code coverage enabled"
- $t $(MAKE) -C $(APP) ct COVER=1 $v
- $i "Check that the generated files exist"
- $t test -f $(APP)/cover/ct.coverdata
- $t test -f $(APP)/test/ct.cover.spec
- $i "Check that the generated files are removed on clean"
- $t $(MAKE) -C $(APP) clean $v
- $t test ! -e $(APP)/cover/ct.coverdata
- $t test ! -e $(APP)/test/ct.cover.spec
- cover-ct-excl-mods: init
- $i "Bootstrap a new OTP application named $(APP)"
- $t mkdir $(APP)/
- $t cp ../erlang.mk $(APP)/
- $t $(MAKE) -C $(APP) -f erlang.mk bootstrap $v
- $i "Add supervisor module to the cover exclude module list "
- $t perl -ni.bak -e 'print;if ($$.==1) {print "COVER_EXCLUDE_MODS = $(APP)_sup \n"}' $(APP)/Makefile
- $i "Generate a Common Test suite"
- $t mkdir $(APP)/test
- $t printf "%s\n" \
- "-module($(APP)_SUITE)." \
- "-export([all/0, ok/1])." \
- "all() -> [ok]." \
- "ok(_) -> application:start($(APP))." > $(APP)/test/$(APP)_SUITE.erl
- $i "Run Common Test with code coverage enabled"
- $t $(MAKE) -C $(APP) ct COVER=1 $v
- $i "Check that the generated files exist"
- $t test -f $(APP)/cover/ct.coverdata
- $t test -f $(APP)/test/ct.cover.spec
- $i "Check that the supervisor module is not included in the cover report"
- $t ! test -e $(APP)/logs/ct_run.*/$(APP)_sup.COVER.html
- cover-ct-incl-apps: init
- $i "Bootstrap a new OTP application named $(APP)"
- $t mkdir $(APP)/
- $t cp ../erlang.mk $(APP)/
- $t $(MAKE) -C $(APP) -f erlang.mk bootstrap $v
- $i "Create a new application app_one"
- $t $(MAKE) -C $(APP) new-app in=app_one $v
- $i "Create a new application app_two"
- $t $(MAKE) -C $(APP) new-app in=app_two $v
- $i "Create a new application app_three"
- $t $(MAKE) -C $(APP) new-app in=app_three $v
- $i "Add all three apps to LOCAL_DEPS"
- $t perl -ni.bak -e 'print;if ($$.==1) {print "LOCAL_DEPS = app_one app_two app_three\n"}' $(APP)/Makefile
- ifdef LEGACY
- $i "Add all three apps to the applications key in the .app.src file"
- $t perl -ni.bak -e 'print;if ($$.==7) {print "\t\tapp_one,\n\t\tapp_two,\n\t\tapp_three,\n"}' $(APP)/src/$(APP).app.src
- endif
- $i "Add app_one and app_three to the code coverage"
- $t perl -ni.bak -e 'print;if ($$.==1) {print "COVER_APPS = app_one app_three\n"}' $(APP)/Makefile
- $i "Generate a Common Test suite"
- $t mkdir $(APP)/test
- $t printf "%s\n" \
- "-module($(APP)_SUITE)." \
- "-export([all/0, ok/1])." \
- "all() -> [ok]." \
- "ok(_) -> application:ensure_all_started($(APP))." > $(APP)/test/$(APP)_SUITE.erl
- $i "Run Common Test with code coverage enabled"
- $t $(MAKE) -C $(APP) ct COVER=1 $v
- $i "Check that app_one and app_three were covered, but app_two wasn't"
- $t test -f $(APP)/logs/ct_run.*/app_one_app.COVER.html
- $t test -f $(APP)/logs/ct_run.*/app_three_app.COVER.html
- $t ! test -e $(APP)/logs/ct_run.*/app_two_app.COVER.html
- cover-ct-incl-apps-default: init
- $i "Bootstrap a new OTP application named $(APP)"
- $t mkdir $(APP)/
- $t cp ../erlang.mk $(APP)/
- $t $(MAKE) -C $(APP) -f erlang.mk bootstrap $v
- $i "Create a new application app_one"
- $t $(MAKE) -C $(APP) new-app in=app_one $v
- $i "Create a new application app_two"
- $t $(MAKE) -C $(APP) new-app in=app_two $v
- $i "Create a new application app_three"
- $t $(MAKE) -C $(APP) new-app in=app_three $v
- $i "Add all three apps to LOCAL_DEPS"
- $t perl -ni.bak -e 'print;if ($$.==1) {print "LOCAL_DEPS = app_one app_two app_three\n"}' $(APP)/Makefile
- ifdef LEGACY
- $i "Add all three apps to the applications key in the .app.src file"
- $t perl -ni.bak -e 'print;if ($$.==7) {print "\t\tapp_one,\n\t\tapp_two,\n\t\tapp_three,\n"}' $(APP)/src/$(APP).app.src
- endif
- $i "Generate a Common Test suite"
- $t mkdir $(APP)/test
- $t printf "%s\n" \
- "-module($(APP)_SUITE)." \
- "-export([all/0, ok/1])." \
- "all() -> [ok]." \
- "ok(_) -> application:ensure_all_started($(APP))." > $(APP)/test/$(APP)_SUITE.erl
- $i "Run Common Test with code coverage enabled"
- $t $(MAKE) -C $(APP) ct COVER=1 $v
- $i "Check that all apps were covered by default"
- $t test -f $(APP)/logs/ct_run.*/app_one_app.COVER.html
- $t test -f $(APP)/logs/ct_run.*/app_two_app.COVER.html
- $t test -f $(APP)/logs/ct_run.*/app_three_app.COVER.html
- cover-ct-incl-deps: init
- $i "Bootstrap a new OTP application named $(APP)"
- $t mkdir $(APP)/
- $t cp ../erlang.mk $(APP)/
- $t $(MAKE) -C $(APP) -f erlang.mk bootstrap $v
- $i "Add Cowboy 1.0.0 to the list of dependencies"
- $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowboy\ndep_cowboy_commit = 1.0.0\n"}' $(APP)/Makefile
- ifdef LEGACY
- $i "Add Cowboy to the applications key in the .app.src file"
- $t perl -ni.bak -e 'print;if ($$.==7) {print "\t\tcowboy,\n"}' $(APP)/src/$(APP).app.src
- endif
- $i "Add Cowboy and Cowlib to the code coverage"
- $t perl -ni.bak -e 'print;if ($$.==1) {print "COVER_DEPS = cowboy cowlib\n"}' $(APP)/Makefile
- $i "Generate a Common Test suite"
- $t mkdir $(APP)/test
- $t printf "%s\n" \
- "-module($(APP)_SUITE)." \
- "-export([all/0, ok/1])." \
- "all() -> [ok]." \
- "ok(_) -> application:ensure_all_started($(APP))." > $(APP)/test/$(APP)_SUITE.erl
- $i "Run Common Test with code coverage enabled"
- $t $(MAKE) -C $(APP) ct COVER=1 $v
- $i "Check that Cowboy and Cowlib were covered, but Ranch wasn't"
- $t test -f $(APP)/logs/ct_run.*/cowboy_app.COVER.html
- $t test -f $(APP)/logs/ct_run.*/cow_http_hd.COVER.html
- $t ! test -e $(APP)/logs/ct_run.*/ranch_app.COVER.html
- cover-ct-single-suite: init
- $i "Bootstrap a new OTP application named $(APP)"
- $t mkdir $(APP)/
- $t cp ../erlang.mk $(APP)/
- $t $(MAKE) -C $(APP) -f erlang.mk bootstrap $v
- $i "Generate a Common Test suite"
- $t mkdir $(APP)/test
- $t printf "%s\n" \
- "-module($(APP)_SUITE)." \
- "-export([all/0, ok/1])." \
- "all() -> [ok]." \
- "ok(_) -> application:start($(APP))." > $(APP)/test/$(APP)_SUITE.erl
- $i "Run Common Test against this specific test suite with code coverage enabled"
- $t $(MAKE) -C $(APP) ct-$(APP) COVER=1 $v
- $i "Check that the generated files exist"
- $t test -f $(APP)/cover/ct.coverdata
- $t test -f $(APP)/test/ct.cover.spec
- $i "Check that the generated files are removed on clean"
- $t $(MAKE) -C $(APP) clean $v
- $t test ! -e $(APP)/cover/ct.coverdata
- $t test ! -e $(APP)/test/ct.cover.spec
- cover-custom-dir: init
- $i "Bootstrap a new OTP application named $(APP)"
- $t mkdir $(APP)/
- $t cp ../erlang.mk $(APP)/
- $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
- $i "Set COVER_DATA_DIR in the Makefile"
- $t perl -ni.bak -e 'print;if ($$.==1) {print "COVER_DATA_DIR = custom_dir\n"}' $(APP)/Makefile
- $i "Generate a module containing EUnit tests"
- $t printf "%s\n" \
- "-module($(APP))." \
- "-ifdef(TEST)." \
- "-include_lib(\"eunit/include/eunit.hrl\")." \
- "ok_test() -> ok." \
- "-endif." > $(APP)/src/$(APP).erl
- $i "Generate a Common Test suite"
- $t mkdir $(APP)/test
- $t printf "%s\n" \
- "-module($(APP)_SUITE)." \
- "-export([all/0, ok/1])." \
- "all() -> [ok]." \
- "ok(_) -> ok." > $(APP)/test/$(APP)_SUITE.erl
- $i "Run Common Test with code coverage enabled"
- $t $(MAKE) -C $(APP) ct COVER=1 $v
- $i "Run EUnit with code coverage enabled"
- $t $(MAKE) -C $(APP) eunit COVER=1 $v
- $i "Check that the generated file exists"
- $t test -f $(APP)/custom_dir/ct.coverdata
- $t test -f $(APP)/custom_dir/eunit.coverdata
- $i "Merge coverdata files into all.coverdata"
- $t $(MAKE) -C $(APP) all.coverdata $v
- $t test -f $(APP)/custom_dir/all.coverdata
- $i "Check that the generated file is removed on clean"
- $t $(MAKE) -C $(APP) clean $v
- $t test ! -e $(APP)/custom_dir/eunit.coverdata
- $t test ! -e $(APP)/custom_dir/ct.coverdata
- $t test ! -e $(APP)/custom_dir/all.coverdata
- $i "Check that the custom dir is removed on distclean"
- $t $(MAKE) -C $(APP) distclean $v
- $t test ! -e $(APP)/custom_dir/
- $i "Check that the custom dir is not removed if not empty"
- $t mkdir $(APP)/custom_dir
- $t touch $(APP)/custom_dir/file
- $t $(MAKE) -C $(APP) distclean $v
- $t test -f $(APP)/custom_dir/file
- cover-eunit: init
- $i "Bootstrap a new OTP application named $(APP)"
- $t mkdir $(APP)/
- $t cp ../erlang.mk $(APP)/
- $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
- $i "Generate a module containing EUnit tests"
- $t printf "%s\n" \
- "-module($(APP))." \
- "-ifdef(TEST)." \
- "-include_lib(\"eunit/include/eunit.hrl\")." \
- "ok_test() -> ok." \
- "-endif." > $(APP)/src/$(APP).erl
- $i "Run EUnit with code coverage enabled"
- $t $(MAKE) -C $(APP) eunit COVER=1 $v
- $i "Check that the generated file exists"
- $t test -f $(APP)/cover/eunit.coverdata
- $i "Check that the generated file is removed on clean"
- $t $(MAKE) -C $(APP) clean $v
- $t test ! -e $(APP)/cover/eunit.coverdata
- cover-eunit-apps-only: init
- $i "Create a multi application repository with no root application"
- $t mkdir $(APP)/
- $t cp ../erlang.mk $(APP)/
- $t echo "include erlang.mk" > $(APP)/Makefile
- $i "Create a new application named my_app"
- $t $(MAKE) -C $(APP) new-app in=my_app $v
- $i "Generate a module containing EUnit tests in my_app"
- $t printf "%s\n" \
- "-module(my_app)." \
- "-ifdef(TEST)." \
- "-include_lib(\"eunit/include/eunit.hrl\")." \
- "ok_test() -> ok." \
- "-endif." > $(APP)/apps/my_app/src/my_app.erl
- $i "Run EUnit with code coverage enabled"
- $t $(MAKE) -C $(APP) eunit COVER=1 $v
- $i "Check that no file was generated in the top-level directory"
- $t ! test -f $(APP)/cover/eunit.coverdata
- $i "Check that the generated file exists"
- $t test -f $(APP)/apps/my_app/cover/eunit.coverdata
- cover-eunit-excl-mods: init
- $i "Bootstrap a new OTP application named $(APP)"
- $t mkdir $(APP)/
- $t cp ../erlang.mk $(APP)/
- $t $(MAKE) -C $(APP) -f erlang.mk bootstrap $v
- $i "Add supervisor module to the cover exclude module list "
- $t perl -ni.bak -e 'print;if ($$.==1) {print "COVER_EXCLUDE_MODS = $(APP)_sup \n"}' $(APP)/Makefile
- $i "Generate a module containing EUnit tests"
- $t printf "%s\n" \
- "-module($(APP))." \
- "-ifdef(TEST)." \
- "-include_lib(\"eunit/include/eunit.hrl\")." \
- "ok_test() -> application:ensure_all_started($(APP))." \
- "-endif." > $(APP)/src/$(APP).erl
- $i "Run EUnit with code coverage enabled"
- $t $(MAKE) -C $(APP) eunit COVER=1 $v
- $i "Build the cover report"
- $t $(MAKE) -C $(APP) cover-report $v
- $i "Check that app was covered, but supervisor wasn't"
- $t test -f $(APP)/cover/$(APP)_app.COVER.html
- $t ! test -e $(APP)/cover/$(APP)_sup.COVER.html
- cover-eunit-incl-apps: init
- $i "Bootstrap a new OTP application named $(APP)"
- $t mkdir $(APP)/
- $t cp ../erlang.mk $(APP)/
- $t $(MAKE) -C $(APP) -f erlang.mk bootstrap $v
- $i "Create a new application app_one"
- $t $(MAKE) -C $(APP) new-app in=app_one $v
- $i "Create a new application app_two"
- $t $(MAKE) -C $(APP) new-app in=app_two $v
- $i "Create a new application app_three"
- $t $(MAKE) -C $(APP) new-app in=app_three $v
- $i "Add all three apps to LOCAL_DEPS"
- $t perl -ni.bak -e 'print;if ($$.==1) {print "LOCAL_DEPS = app_one app_two app_three\n"}' $(APP)/Makefile
- ifdef LEGACY
- $i "Add all three apps to the applications key in the .app.src file"
- $t perl -ni.bak -e 'print;if ($$.==7) {print "\t\tapp_one,\n\t\tapp_two,\n\t\tapp_three,\n"}' $(APP)/src/$(APP).app.src
- endif
- $i "Add app_one and app_three to the code coverage"
- $t perl -ni.bak -e 'print;if ($$.==1) {print "COVER_APPS = app_one app_three\n"}' $(APP)/Makefile
- $i "Generate a module containing EUnit tests"
- $t printf "%s\n" \
- "-module($(APP))." \
- "-ifdef(TEST)." \
- "-include_lib(\"eunit/include/eunit.hrl\")." \
- "ok_test() -> application:ensure_all_started($(APP))." \
- "-endif." > $(APP)/src/$(APP).erl
- $i "Run EUnit with code coverage enabled"
- $t $(MAKE) -C $(APP) eunit COVER=1 $v
- $i "Build the cover report"
- $t $(MAKE) -C $(APP) cover-report $v
- $i "Check that app_one and app_three were covered, but app_two wasn't"
- $t test -f $(APP)/cover/app_one_app.COVER.html
- $t test -f $(APP)/cover/app_three_app.COVER.html
- $t ! test -e $(APP)/cover/app_two_app.COVER.html
- cover-eunit-incl-apps-default: init
- $i "Bootstrap a new OTP application named $(APP)"
- $t mkdir $(APP)/
- $t cp ../erlang.mk $(APP)/
- $t $(MAKE) -C $(APP) -f erlang.mk bootstrap $v
- $i "Create a new application app_one"
- $t $(MAKE) -C $(APP) new-app in=app_one $v
- $i "Create a new application app_two"
- $t $(MAKE) -C $(APP) new-app in=app_two $v
- $i "Create a new application app_three"
- $t $(MAKE) -C $(APP) new-app in=app_three $v
- $i "Add all three apps to LOCAL_DEPS"
- $t perl -ni.bak -e 'print;if ($$.==1) {print "LOCAL_DEPS = app_one app_two app_three\n"}' $(APP)/Makefile
- ifdef LEGACY
- $i "Add all three apps to the applications key in the .app.src file"
- $t perl -ni.bak -e 'print;if ($$.==7) {print "\t\tapp_one,\n\t\tapp_two,\n\t\tapp_three,\n"}' $(APP)/src/$(APP).app.src
- endif
- $i "Generate a module containing EUnit tests"
- $t printf "%s\n" \
- "-module($(APP))." \
- "-ifdef(TEST)." \
- "-include_lib(\"eunit/include/eunit.hrl\")." \
- "ok_test() -> application:ensure_all_started($(APP))." \
- "-endif." > $(APP)/src/$(APP).erl
- $i "Run EUnit with code coverage enabled"
- $t $(MAKE) -C $(APP) eunit COVER=1 $v
- $i "Build the cover report"
- $t $(MAKE) -C $(APP) cover-report $v
- $i "Check that all apps were covered by default"
- $t test -f $(APP)/cover/app_one_app.COVER.html
- $t test -f $(APP)/cover/app_two_app.COVER.html
- $t test -f $(APP)/cover/app_three_app.COVER.html
- cover-eunit-incl-deps: init
- $i "Bootstrap a new OTP application named $(APP)"
- $t mkdir $(APP)/
- $t cp ../erlang.mk $(APP)/
- $t $(MAKE) -C $(APP) -f erlang.mk bootstrap $v
- $i "Add Cowboy 1.0.0 to the list of dependencies"
- $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowboy\ndep_cowboy_commit = 1.0.0\n"}' $(APP)/Makefile
- ifdef LEGACY
- $i "Add Cowboy to the applications key in the .app.src file"
- $t perl -ni.bak -e 'print;if ($$.==7) {print "\t\tcowboy,\n"}' $(APP)/src/$(APP).app.src
- endif
- $i "Add Cowboy and Cowlib to the code coverage"
- $t perl -ni.bak -e 'print;if ($$.==1) {print "COVER_DEPS = cowboy cowlib\n"}' $(APP)/Makefile
- $i "Generate a module containing EUnit tests"
- $t printf "%s\n" \
- "-module($(APP))." \
- "-ifdef(TEST)." \
- "-include_lib(\"eunit/include/eunit.hrl\")." \
- "ok_test() -> application:ensure_all_started($(APP))." \
- "-endif." > $(APP)/src/$(APP).erl
- $i "Run EUnit with code coverage enabled"
- $t $(MAKE) -C $(APP) eunit COVER=1 $v
- $i "Build the cover report"
- $t $(MAKE) -C $(APP) cover-report $v
- $i "Check that Cowboy and Cowlib were covered, but Ranch wasn't"
- $t test -f $(APP)/cover/cowboy_app.COVER.html
- $t test -f $(APP)/cover/cow_http_hd.COVER.html
- $t ! test -e $(APP)/cover/ranch_app.COVER.html
- cover-proper: init
- $i "Bootstrap a new OTP application named $(APP)"
- $t mkdir $(APP)/
- $t cp ../erlang.mk $(APP)/
- $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
- $i "Add PropEr to the list of dependencies"
- $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = proper\n"}' $(APP)/Makefile
- $i "Generate a module containing Proper properties"
- $t printf "%s\n" \
- "-module($(APP))." \
- "-ifdef(TEST)." \
- "-include_lib(\"proper/include/proper.hrl\")." \
- "prop_foo() -> ?FORALL(_, any(), true)." \
- "-endif." > $(APP)/src/$(APP).erl
- $i "Run PropEr with code coverage enabled"
- $t $(MAKE) -C $(APP) proper COVER=1 $v
- $i "Check that the generated file exists"
- $t test -f $(APP)/cover/proper.coverdata
- $i "Check that the generated file is removed on clean"
- $t $(MAKE) -C $(APP) clean $v
- $t test ! -e $(APP)/cover/proper.coverdata
- cover-report-and-merge: init
- $i "Bootstrap a new OTP application named $(APP)"
- $t mkdir $(APP)/
- $t cp ../erlang.mk $(APP)/
- $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
- $i "Generate a Common Test suite"
- $t mkdir $(APP)/test
- $t printf "%s\n" \
- "-module($(APP)_SUITE)." \
- "-export([all/0, ok/1])." \
- "all() -> [ok]." \
- "ok(_) -> ok." > $(APP)/test/$(APP)_SUITE.erl
- $i "Generate a module containing EUnit tests"
- $t printf "%s\n" \
- "-module($(APP))." \
- "-ifdef(TEST)." \
- "-include_lib(\"eunit/include/eunit.hrl\")." \
- "ok_test() -> ok." \
- "-endif." > $(APP)/src/$(APP).erl
- $i "Run tests with code coverage enabled"
- $t $(MAKE) -C $(APP) tests COVER=1 $v
- $i "Check that the generated files exist"
- $t test -f $(APP)/cover/$(APP).COVER.html
- $t test -f $(APP)/cover/index.html
- $t test -f $(APP)/cover/ct.coverdata
- $t test -f $(APP)/cover/eunit.coverdata
- $t test -f $(APP)/test/ct.cover.spec
- $i "Merge coverdata files into all.coverdata"
- $t $(MAKE) -C $(APP) all.coverdata $v
- $t test -f $(APP)/cover/all.coverdata
- $i "Check that the generated files are removed on clean"
- $t $(MAKE) -C $(APP) clean $v
- $t test ! -e $(APP)/cover/all.coverdata
- $t test ! -e $(APP)/cover/ct.coverdata
- $t test ! -e $(APP)/cover/eunit.coverdata
- $t test ! -e $(APP)/test/ct.cover.spec
- $i "Check that the cover report is removed on distclean"
- $t $(MAKE) -C $(APP) distclean $v
- $t test ! -e $(APP)/cover/
- cover-triq: init
- $i "Bootstrap a new OTP application named $(APP)"
- $t mkdir $(APP)/
- $t cp ../erlang.mk $(APP)/
- $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
- $i "Add Triq to the list of dependencies"
- $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = triq\n"}' $(APP)/Makefile
- $i "Generate a module containing Triq properties"
- $t printf "%s\n" \
- "-module($(APP))." \
- "-ifdef(TEST)." \
- "-include_lib(\"triq/include/triq.hrl\")." \
- "prop_foo() -> ?FORALL(_, any(), true)." \
- "-endif." > $(APP)/src/$(APP).erl
- $i "Run Triq with code coverage enabled"
- $t $(MAKE) -C $(APP) triq COVER=1 $v
- $i "Check that the generated file exists"
- $t test -f $(APP)/cover/triq.coverdata
- $i "Check that the generated file is removed on clean"
- $t $(MAKE) -C $(APP) clean $v
- $t test ! -e $(APP)/cover/triq.coverdata
|