From b9df145b79d50faff7ebfa035e74888c3130f3cf Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 11 Feb 2020 23:43:10 +0100 Subject: [PATCH] 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. --- tests/Makefile.in | 15 +++++---------- tests/test.bkl | 11 +++-------- 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/tests/Makefile.in b/tests/Makefile.in index ad815b113b..6ac5346604 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -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; \ diff --git a/tests/test.bkl b/tests/test.bkl index 00f0c0b013..3349de542d 100644 --- a/tests/test.bkl +++ b/tests/test.bkl @@ -348,16 +348,11 @@ -# 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; \ @@ -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.">&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.">&2; \ exit 1; \ fi; \