aboutsummaryrefslogtreecommitdiffstats
path: root/test/plugin_concuerror.mk
blob: f1b92884e8fdb05b465d996f52d439b1927dc848 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Concuerror plugin.

CONCUERROR_TARGETS = $(call list_targets,concuerror)

.PHONY: concuerror $(CONCUERROR_TARGETS)

concuerror: $(CONCUERROR_TARGETS)

concuerror-app: 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 test module with a function that returns immediately"
	$t mkdir $(APP)/test
	$t printf "%s\n" \
		"-module(concuerror_success)." \
		"-export([test/0])." \
		"test() -> ok." > $(APP)/test/concuerror_success.erl

	$i "Add the test case to CONCUERROR_TESTS"
	$t perl -ni.bak -e 'print;if ($$.==1) {print "CONCUERROR_TESTS += concuerror_success:test\n"}' $(APP)/Makefile

	$i "Confirm that Concuerror completes successfully"
	$t $(MAKE) -C $(APP) concuerror $v

	$i "Create a test module with a function that has no local return"
	$t printf "%s\n" \
		"-module(concuerror_error)." \
		"-export([test/0])." \
		"test() -> 1 = 2, ok." > $(APP)/test/concuerror_error.erl

	$i "Add the test case to CONCUERROR_TESTS"
	$t perl -ni.bak -e 'print;if ($$.==1) {print "CONCUERROR_TESTS += concuerror_error:test\n"}' $(APP)/Makefile

	$i "Confirm that Concuerror errors out"
	$t ! $(MAKE) -C $(APP) concuerror $v