Stop using non-existent CXXWARNINGS for failing tests checks

This variable doesn't exist any more, but now it's possible to use
CPPFLAGS directly and get rid of the hack which required it to be used
in the first place.
This commit is contained in:
Vadim Zeitlin 2020-02-11 23:43:10 +01:00
parent 7db9b707b2
commit b9df145b79
2 changed files with 8 additions and 18 deletions

View File

@ -1084,16 +1084,11 @@ test_gui_xrctest.o: $(srcdir)/xml/xrctest.cpp $(TEST_GUI_ODEP)
$(CXXC) -c -o $@ $(TEST_GUI_CXXFLAGS) $(srcdir)/xml/xrctest.cpp
# notice the ugly hack with using CXXWARNINGS: we can't use CPPFLAGS as
# currently the value in the makefile would be ignored if we did, but
# warnings don't matter when we expect compilation to fail anyhow so we can
# use this variable to enable the compilation of code which is supposed to
# fail
failtest: failtest_combobox failtest_evthandler failtest_weakref
failtest_combobox:
@$(RM) test_gui_comboboxtest.o
if $(MAKE) CXXWARNINGS=-DTEST_INVALID_COMBOBOX_ISEMPTY test_gui_comboboxtest.o 2>/dev/null; then \
if $(MAKE) CPPFLAGS=-DTEST_INVALID_COMBOBOX_ISEMPTY test_gui_comboboxtest.o 2>/dev/null; then \
echo "*** Compilation with TEST_INVALID_COMBOBOX_ISEMPTY unexpectedly succeeded.">&2; \
exit 1; \
fi; \
@ -1101,9 +1096,9 @@ failtest_combobox:
failtest_evthandler:
@$(RM) test_evthandler.o
@for d in GLOBAL STATIC METHOD FUNCTOR NO_HANDLER DERIVED WRONG_CLASS; do \
if $(MAKE) CXXWARNINGS=-DTEST_INVALID_BIND_$$d test_evthandler.o 2>/dev/null; then \
echo "*** Compilation with TEST_INVALID_BIND_$$d unexpectedly succeeded.">&2; \
@for d in BIND_GLOBAL BIND_STATIC BIND_METHOD BIND_FUNCTOR BIND_NO_HANDLER BIND_DERIVED BIND_WRONG_CLASS EVENT_CREATION; do \
if $(MAKE) CPPFLAGS=-DTEST_INVALID_$$d test_evthandler.o 2>/dev/null; then \
echo "*** Compilation with TEST_INVALID_$$d unexpectedly succeeded.">&2; \
exit 1; \
fi; \
done; \
@ -1111,7 +1106,7 @@ failtest_evthandler:
failtest_weakref:
@$(RM) test_weakref.o
if $(MAKE) CXXWARNINGS=-DTEST_INVALID_INCOMPLETE_WEAKREF test_weakref.o 2>/dev/null; then \
if $(MAKE) CPPFLAGS=-DTEST_INVALID_INCOMPLETE_WEAKREF test_weakref.o 2>/dev/null; then \
echo "*** Compilation with TEST_INVALID_INCOMPLETE_WEAKREF unexpectedly succeeded.">&2; \
exit 1; \
fi; \

View File

@ -348,16 +348,11 @@
<fragment format="autoconf">
# notice the ugly hack with using CXXWARNINGS: we can't use CPPFLAGS as
# currently the value in the makefile would be ignored if we did, but
# warnings don't matter when we expect compilation to fail anyhow so we can
# use this variable to enable the compilation of code which is supposed to
# fail
failtest: failtest_combobox failtest_evthandler failtest_weakref
failtest_combobox:
@$(RM) test_gui_comboboxtest.o
if $(MAKE) CXXWARNINGS=-DTEST_INVALID_COMBOBOX_ISEMPTY test_gui_comboboxtest.o 2>/dev/null; then \
if $(MAKE) CPPFLAGS=-DTEST_INVALID_COMBOBOX_ISEMPTY test_gui_comboboxtest.o 2>/dev/null; then \
echo "*** Compilation with TEST_INVALID_COMBOBOX_ISEMPTY unexpectedly succeeded.">&amp;2; \
exit 1; \
fi; \
@ -366,7 +361,7 @@ failtest_combobox:
failtest_evthandler:
@$(RM) test_evthandler.o
@for d in BIND_GLOBAL BIND_STATIC BIND_METHOD BIND_FUNCTOR BIND_NO_HANDLER BIND_DERIVED BIND_WRONG_CLASS EVENT_CREATION; do \
if $(MAKE) CXXWARNINGS=-DTEST_INVALID_$$d test_evthandler.o 2>/dev/null; then \
if $(MAKE) CPPFLAGS=-DTEST_INVALID_$$d test_evthandler.o 2>/dev/null; then \
echo "*** Compilation with TEST_INVALID_$$d unexpectedly succeeded.">&amp;2; \
exit 1; \
fi; \
@ -375,7 +370,7 @@ failtest_evthandler:
failtest_weakref:
@$(RM) test_weakref.o
if $(MAKE) CXXWARNINGS=-DTEST_INVALID_INCOMPLETE_WEAKREF test_weakref.o 2>/dev/null; then \
if $(MAKE) CPPFLAGS=-DTEST_INVALID_INCOMPLETE_WEAKREF test_weakref.o 2>/dev/null; then \
echo "*** Compilation with TEST_INVALID_INCOMPLETE_WEAKREF unexpectedly succeeded.">&amp;2; \
exit 1; \
fi; \