aboutsummaryrefslogtreecommitdiffstats
path: root/test/Makefile
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2017-05-13 15:37:24 +0200
committerLoïc Hoguin <[email protected]>2017-05-13 15:37:24 +0200
commit68bb586e605c62ba9fc7c7bebe14529121dcc53a (patch)
treec26c69abada45dc1ffcff8b2c7f21308539eaf21 /test/Makefile
parent28ab68285c5e7611ef0e450b5611e666c3253add (diff)
downloaderlang.mk-68bb586e605c62ba9fc7c7bebe14529121dcc53a.tar.gz
erlang.mk-68bb586e605c62ba9fc7c7bebe14529121dcc53a.tar.bz2
erlang.mk-68bb586e605c62ba9fc7c7bebe14529121dcc53a.zip
Convert legacy cover tests and fix a few issues
There are no more legacy tests. Enjoy!
Diffstat (limited to 'test/Makefile')
-rw-r--r--test/Makefile81
1 files changed, 0 insertions, 81 deletions
diff --git a/test/Makefile b/test/Makefile
index 0640a7d..b5e1747 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -276,84 +276,3 @@ pkg-$1: build clean
endef
$(foreach pkg,$(PACKAGES),$(eval $(call pkg_target,$(pkg))))
-
-##################
-
-# Test application used for testing.
-app1:
- $(call app1_setup)
-
-# Extra module in app1 used for testing eunit
-define create-module-t
-printf '%s\n' \
- '-module(t).' \
- '-export([succ/1]).' \
- 'succ(N) -> N + 1.' \
- '-ifdef(TEST).' \
- '-include_lib("eunit/include/eunit.hrl").' \
- 'succ_test() ->' \
- ' ?assertEqual(2, succ(1)),' \
- ' os:cmd("echo t >> test-eunit.log").' \
- '-endif.' \
- > app1/src/t.erl
-endef
-
-# Legacy tests.
-#
-# The following tests are slowly being converted.
-# Do NOT use -j with legacy tests.
-
-.PHONY: legacy clean-legacy tests-cover
-
-legacy: clean-legacy tests-cover
-
-clean-legacy:
- $t rm -rf app1
-
-# TODO: do coverage for 'tests' instead of 'eunit ct' when triq is fixed
-tests-cover: app1
- $i "tests-cover: Testing 'eunit' and 'ct' with COVER=1"
- $i "Setting up eunit and ct suites."
- $t $(call create-module-t)
- $t mkdir -p app1/test
- $t printf "%s\n" \
- "-module(m_SUITE)." \
- "-export([all/0, testcase1/1])." \
- "all() -> [testcase1]." \
- "testcase1(_) -> 2 = m:succ(1)." \
- > app1/test/m_SUITE.erl
- $i "Running tests with coverage analysis."
- $t $(MAKE) -C app1 eunit ct COVER=1 $v
- $t [ -e app1/test-eunit.log ]
- $t [ -e app1/eunit.coverdata ]
- $t [ -e app1/ct.coverdata ]
- $i "Generating coverage report."
- $t $(MAKE) -C app1 cover-report COVER=1 $v
- $t [ -e app1/cover/m.COVER.html ]
- $t [ -e app1/cover/t.COVER.html ]
- $t [ -e app1/cover/index.html ]
- $i "Checking combined coverage from eunit and ct."
- $t [ `grep 'Total: 100%' app1/cover/index.html | wc -l` -eq 1 ]
- $i "Checking that cover-report-clean removes cover report."
- $t $(MAKE) -C app1 cover-report-clean $v
- $t [ ! -e app1/cover ]
- $i "Checking that coverdata-clean removes cover data."
- $t $(MAKE) -C app1 coverdata-clean $v
- $t [ ! -e app1/eunit.coverdata ]
- @# clean up
- $t rm -rf app1/src/t.erl app1/test app1/test-eunit.log
- $t $(MAKE) -C app1 clean $v
- $i "Test 'tests-cover' passed."
-
-define app1_setup
- $i "Setting up app."
- $t mkdir -p app1
- $t cd .. && $(MAKE)
- $t cp ../erlang.mk app1/
- $t $(MAKE) -C app1 -f erlang.mk bootstrap-lib
- $t printf "%s\n" \
- "-module(m)." \
- "-export([succ/1])." \
- "succ(N) -> N + 1." \
- > app1/src/m.erl
-endef