The existing typemaps didn't work at all and making them work would require defining all the typemaps needed by the Unified Typemaps Library, which seems to be geared towards dynamic languages. Just implement completely straightforward (and not very convenient to use) typemaps instead. Enable the now passing unit tests and add a runme for one of them.
186 lines
4.8 KiB
Makefile
186 lines
4.8 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@
|
|
|
|
# This can be set to ":" to avoid progress messages.
|
|
ECHO_PROGRESS := echo
|
|
|
|
CPP_TEST_CASES := \
|
|
cpp_basic_class \
|
|
cpp_basic_class_method \
|
|
cpp_basic_class_virtual_method \
|
|
cpp_basic_class_var_pub_member_built_in \
|
|
cpp_basic_class_var_pub_member_class \
|
|
cpp_basic_global_var_class \
|
|
cpp_basic_namespaced_class \
|
|
cpp_basic_template_function \
|
|
cpp_basic_template_class \
|
|
c_backend_cpp_natural_std_string \
|
|
c_backend_cpp_exception
|
|
|
|
# The following tests are currently broken and need to be fixed.
|
|
FAILING_C_TESTS := \
|
|
arrays \
|
|
funcptr \
|
|
function_typedef \
|
|
lextype \
|
|
li_carrays \
|
|
nested \
|
|
nested_extend_c \
|
|
nested_structs \
|
|
typedef_struct \
|
|
union_parameter \
|
|
unions \
|
|
|
|
FAILING_CPP_TESTS := \
|
|
apply_signed_char \
|
|
array_member \
|
|
array_typedef_memberin \
|
|
arrayref \
|
|
arrays_dimensionless \
|
|
arrays_global \
|
|
arrays_global_twodim \
|
|
constant_pointers \
|
|
director_smartptr \
|
|
director_string \
|
|
enum_thorough \
|
|
extend \
|
|
extend_default \
|
|
extern_c \
|
|
extern_template_method \
|
|
funcptr_cpp \
|
|
global_scope_types \
|
|
grouping \
|
|
import_nomodule \
|
|
li_attribute \
|
|
li_boost_shared_ptr \
|
|
li_boost_shared_ptr_bits \
|
|
li_boost_shared_ptr_director \
|
|
li_boost_shared_ptr_template \
|
|
li_std_deque \
|
|
li_std_map \
|
|
li_std_pair_using \
|
|
li_std_wstring \
|
|
li_windows \
|
|
member_funcptr_galore \
|
|
member_pointer \
|
|
member_pointer_const \
|
|
mixed_types \
|
|
multiple_inheritance_shared_ptr \
|
|
nested_class \
|
|
smart_pointer_template_defaults_overload \
|
|
stl_no_default_constructor \
|
|
template_basic \
|
|
template_default \
|
|
template_enum \
|
|
template_explicit \
|
|
template_typedef_fnc \
|
|
typedef_array_member \
|
|
typedef_funcptr \
|
|
typedef_struct_cpp \
|
|
typemap_array_qualifiers \
|
|
typemap_namespace \
|
|
typemap_various \
|
|
using_extend \
|
|
varargs \
|
|
varargs_overload \
|
|
virtual_poly \
|
|
|
|
FAILING_CPP11_TESTS := \
|
|
cpp11_alternate_function_syntax \
|
|
cpp11_ref_qualifiers \
|
|
cpp11_ref_qualifiers_typemaps \
|
|
cpp11_result_of \
|
|
cpp11_rvalue_reference \
|
|
cpp11_rvalue_reference2 \
|
|
cpp11_rvalue_reference3 \
|
|
cpp11_type_aliasing \
|
|
|
|
FAILING_MULTI_CPP_TESTS := \
|
|
clientdata_prop \
|
|
imports \
|
|
import_stl \
|
|
template_typedef_import \
|
|
|
|
# Ignore warnings about failing to apply typemaps because none are defined:
|
|
# usually there is no need for special typemaps in C.
|
|
char_binary.cpptest director_binary_string.cpptest li_typemaps.cpptest li_typemaps_apply.cpptest long_long_apply.cpptest: SWIGOPT += -w453
|
|
|
|
include $(srcdir)/../common.mk
|
|
|
|
SRCDIR = ../$(srcdir)/
|
|
|
|
# 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))
|
|
+if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
|
$(do_run_testcase); \
|
|
else \
|
|
cd $* && for f in `cat $(top_srcdir)/$(EXAMPLES)/$(TEST_SUITE)/$*.list`; do \
|
|
$(call syntax_check_testcase,$${f}) || exit 1; \
|
|
done; \
|
|
fi
|
|
|
|
# Makes a directory for the testcase if it does not exist
|
|
setup = \
|
|
if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
|
$(ECHO_PROGRESS) "$(ACTION)ing testcase $* (with run test) under $(LANGUAGE)" ; \
|
|
else \
|
|
$(ECHO_PROGRESS) "$(ACTION)ing testcase $* under $(LANGUAGE)" ; \
|
|
fi; \
|
|
if [ ! -d $* ]; then \
|
|
mkdir $*; \
|
|
fi;
|
|
|
|
# Checks the header syntax if there is no runnable testcase for it.
|
|
syntax_check_testcase = \
|
|
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile \
|
|
SRCDIR='$(SRCDIR)' \
|
|
INTERFACEDIR='$(INTERFACEDIR)' \
|
|
C_HEADER=$1_wrap.h \
|
|
c_syntax_check
|
|
|
|
# Compiles C files then runs the testcase unconditionally.
|
|
do_run_testcase = \
|
|
cd $* && $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile \
|
|
SRCDIR='$(SRCDIR)' \
|
|
RUNME=$*_runme \
|
|
TARGET='$*' \
|
|
c_run
|
|
|
|
# Only compile and run testcase if a file with _rume.c appended to the testcase
|
|
# name is found, otherwise only check the syntax of the generated files.
|
|
run_testcase = \
|
|
+if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
|
$(do_run_testcase); \
|
|
else \
|
|
cd $* && $(call syntax_check_testcase,$*); \
|
|
fi
|
|
|
|
# Clean: remove testcase directories
|
|
%.clean:
|
|
@if [ -d $* ]; then \
|
|
rm -rf $*; \
|
|
fi;
|
|
|
|
clean:
|
|
@rm -f *_wrap.* *~ *.exe *.dll *.so *.out *runme
|