git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2012-c@13478 626c5289-ae23-0410-ae9c-e8d60b6d4f22
91 lines
2.6 KiB
Makefile
91 lines
2.6 KiB
Makefile
#######################################################################
|
|
# Makefile for C test-suite
|
|
#######################################################################
|
|
|
|
LANGUAGE = c
|
|
C = gcc
|
|
CXX = g++
|
|
SCRIPTSUFFIX = _runme.c
|
|
srcdir = @srcdir@
|
|
top_srcdir = @top_srcdir@/..
|
|
top_builddir = @top_builddir@/..
|
|
|
|
include $(srcdir)/../common.mk
|
|
|
|
CPP_TEST_CASES += \
|
|
cpp_basic_class \
|
|
cpp_basic_class_enum \
|
|
cpp_basic_class_method \
|
|
cpp_basic_class_virtual_method \
|
|
cpp_basic_class_var_pub_member_atom \
|
|
cpp_basic_class_var_pub_member_class \
|
|
cpp_basic_global_enum \
|
|
cpp_basic_global_var_atom \
|
|
cpp_basic_global_var_class \
|
|
cpp_basic_namespaced_class
|
|
|
|
#
|
|
# BROKEN TEST CASES:
|
|
# default_constructor - last case fail: using %extend generates 2 ctors wrappers,
|
|
# both using new, while the class constructor is private
|
|
# extend* - directive %extend is not fully supported yet
|
|
# li* - not supported at all yet
|
|
# long_long_apply - no INPUT, OUTPUT, INOUT typemaps defined
|
|
# template* - not fully supported yet
|
|
#
|
|
|
|
C_CPP_TEST_BROKEN = \
|
|
default_constructor \
|
|
extend \
|
|
extend_default \
|
|
extend_placement \
|
|
li_attribute \
|
|
li_boost_shared_ptr \
|
|
li_carrays \
|
|
li_cdata \
|
|
li_windows \
|
|
long_long_apply
|
|
|
|
# Rules for the different types of tests
|
|
%.cpptest:
|
|
$(setup)
|
|
+(cd $* && $(swig_and_compile_cpp))
|
|
$(run_testcase)
|
|
|
|
%.ctest:
|
|
$(setup)
|
|
+(cd $* && $(swig_and_compile_c))
|
|
$(run_testcase)
|
|
|
|
%.multicpptest:
|
|
$(setup)
|
|
+(cd $* && $(swig_and_compile_multi_cpp))
|
|
$(run_testcase)
|
|
|
|
# Makes a directory for the testcase if it does not exist
|
|
setup = \
|
|
if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
|
echo "$(ACTION)ing testcase $* (with run test) under $(LANGUAGE)" ; \
|
|
else \
|
|
echo "$(ACTION)ing testcase $* under $(LANGUAGE)" ; \
|
|
fi; \
|
|
if [ ! -d $* ]; then \
|
|
mkdir $*; \
|
|
fi;
|
|
|
|
# Compiles C files then runs the testcase. A testcase is only run if
|
|
# a file is found which has _runme.c appended after the testcase name.
|
|
run_testcase = \
|
|
if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then (\
|
|
cd $* && $(COMPILETOOL) $(CC) ../$*_runme.c -L. -l$* -o $*_runme && \
|
|
env LD_LIBRARY_PATH=".:$$LD_LIBRARY_PATH" PATH=".:$$PATH" SHLIB_PATH=".:$$SHLIB_PATH" DYLD_LIBRARY_PATH=".:$$DYLD_LIBRARY_PATH" $(RUNTOOL) ./$*_runme;) \
|
|
fi;
|
|
|
|
# Clean: remove testcase directories
|
|
%.clean:
|
|
@if [ -d $* ]; then \
|
|
rm -rf $*; \
|
|
fi;
|
|
|
|
clean:
|
|
@rm -f *_wrap.* *_proxy.* *~ *.exe *.dll *.so *.out *runme
|