summaryrefslogtreecommitdiff
path: root/Examples/test-suite/chicken/Makefile.in
blob: 3c2f3de545bc90105202267e417ea490a66bab37 (plain)
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#######################################################################
# Makefile for chicken test-suite
#######################################################################

LANGUAGE     = chicken
VARIANT      = 
SCRIPTSUFFIX = _runme.ss
PROXYSUFFIX  = _runme_proxy.ss
srcdir       = @srcdir@
top_srcdir   = @top_srcdir@
top_builddir = @top_builddir@
CHICKEN_CSI  = @CHICKEN_CSI@ -quiet -batch -no-init
SO           = @SO@

#C_TEST_CASES = long_long list_vector pointer_in_out multivalue

# Skip the STD cases for now, except for li_std_string.i
SKIP_CPP_STD_CASES = Yes

CPP_TEST_CASES += li_std_string 

EXTRA_TEST_CASES += chicken_ext_test.externaltest

include $(srcdir)/../common.mk

# Overridden variables here
SWIGOPT += -nounit

# Custom tests - tests with additional commandline options
# If there exists a PROXYSUFFIX runme file, we also generate the wrapper
# with the -proxy argument
%.cppproxy: SWIGOPT += -proxy
%.cppproxy: SCRIPTSUFFIX = $(PROXYSUFFIX)

%.cproxy: SWIGOPT += -proxy
%.cproxy: SCRIPTSUFFIX = $(PROXYSUFFIX)

%.multiproxy: SWIGOPT += -proxy -noclosuses
%.multiproxy: SCRIPTSUFFIX = $(PROXYSUFFIX)

# Rules for the different types of tests
%.cpptest: 
	$(setup)
	+$(swig_and_compile_cpp)
	$(run_testcase)
	if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(PROXYSUFFIX) ]; then \
	  $(MAKE) $*.cppproxy; \
	fi

%.ctest:
	$(setup)
	+$(swig_and_compile_c)
	$(run_testcase)
	if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(PROXYSUFFIX) ]; then \
	  $(MAKE) $*.cproxy; \
	fi

%.multicpptest: 
	$(setup)
	+$(swig_and_compile_multi_cpp)
	$(run_testcase)
	if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(PROXYSUFFIX) ]; then \
	  $(MAKE) $*.multiproxy; \
	fi

%.externaltest:
	$(setup)
	+$(swig_and_compile_external)
	$(run_testcase)

%.cppproxy:
	echo "$(ACTION)ing $(LANGUAGE) testcase $* (with run test) with -proxy"
	+$(swig_and_compile_cpp)
	$(run_testcase)

%.cproxy:
	echo "$(ACTION)ing $(LANGUAGE) testcase $* (with run test) with -proxy"
	+$(swig_and_compile_c)
	$(run_testcase)

%.multiproxy:
	echo "$(ACTION)ing $(LANGUAGE) testcase $* (with run test) with -proxy"
	+$(swig_and_compile_multi_cpp)
	$(run_testcase)

# Runs the testcase. A testcase is only run if
# a file is found which has _runme.scm appended after the testcase name.
run_testcase = \
	if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
	  env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) $(CHICKEN_CSI) $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \
	fi

# Clean
%.clean:
	

clean:
	$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile chicken_clean
	rm -f *.scm