@@ -70,6 +70,31 @@ EXAMPLES = \
7070
7171DIRECTC ?= no
7272
73+ # Examples with known Direct-C limitations (expected to fail in DIRECTC=yes mode)
74+ # These are NOT skipped - they run and failures are allowed only in Direct-C mode
75+ DIRECTC_EXPECTED_FAILURES = \
76+ arrays \
77+ arrays_in_derived_types_issue50 \
78+ default_i8 \
79+ derivedtypes \
80+ derivedtypes_procedure \
81+ dump_package \
82+ fixed_1D_derived_type_array_argument \
83+ fortran_oo \
84+ issue235_allocatable_classes \
85+ issue261_array_shapes \
86+ issue301_complex_types \
87+ issue302_pointer_warning \
88+ issue306_allocatable_realloc \
89+ issue41_abstract_classes \
90+ keep_single_interface \
91+ keyword_renaming_issue160 \
92+ long_subroutine_name \
93+ method_optional \
94+ mockderivetype \
95+ strings \
96+ callback_print_function_issue93
97+
7398all : test
7499
75100test :
@@ -107,14 +132,40 @@ clean_directc:
107132 $(MAKE ) clean_meson
108133
109134test_meson :
135+ @FAILED=" " ; \
136+ EXPECTED_FAILED=" " ; \
110137 for example in ${EXAMPLES} ; do \
111- echo " " ; \
112- echo " " ; \
113138 echo " " ; \
114139 echo " # ---------------------------------------------------" ; \
115- echo " running make test in $$ example" ; \
116- make -C $$ example -f Makefile.meson PYTHON=$(PYTHON ) DIRECTC=$(DIRECTC ) test || echo " FAILED: $$ example" ; \
117- done
140+ echo " Testing: $$ example" ; \
141+ if make -C $$ example -f Makefile.meson PYTHON=$( PYTHON) DIRECTC=$( DIRECTC) test ; then \
142+ echo " PASS: $$ example" ; \
143+ else \
144+ IS_EXPECTED=no ; \
145+ if [ " $( DIRECTC) " = " yes" ] && echo " ${DIRECTC_EXPECTED_FAILURES} " | grep -q " $$ example " ; then \
146+ IS_EXPECTED=yes ; \
147+ echo " EXPECTED FAIL (Direct-C limitation): $$ example" ; \
148+ EXPECTED_FAILED=" $$ EXPECTED_FAILED $$ example" ; \
149+ fi ; \
150+ if [ " $$ IS_EXPECTED" = " no" ]; then \
151+ echo " FAIL: $$ example" ; \
152+ FAILED=" $$ FAILED $$ example" ; \
153+ fi ; \
154+ fi ; \
155+ done ; \
156+ echo " " ; \
157+ echo " ========================================" ; \
158+ if [ -n " $$ EXPECTED_FAILED" ]; then \
159+ echo " Expected failures:$$ EXPECTED_FAILED" ; \
160+ fi ; \
161+ if [ -n " $$ FAILED" ]; then \
162+ echo " UNEXPECTED FAILURES:$$ FAILED" ; \
163+ echo " ========================================" ; \
164+ exit 1 ; \
165+ else \
166+ echo " All tests passed (or expected failures only)" ; \
167+ echo " ========================================" ; \
168+ fi
118169
119170clean_meson :
120171 for example in ${EXAMPLES} ; do \
0 commit comments