Give warnings for unknown Doxygen commands in Doxygen parser.

Silently ignoring unknown Doxygen commands is not a reasonable default
behaviour, it's simple enough to turn off the warning if the command is really
supposed to be just ignored, but it's too easy to not notice a real problem if
it isn't.

Turn WARN_DOXYGEN_UNKNOWN_COMMAND on by default and add a test to the errors
test suite checking that it is indeed given.
This commit is contained in:
Vadim Zeitlin 2014-08-22 22:44:55 +02:00
commit a1d7930835
5 changed files with 39 additions and 7 deletions

View file

@ -24,12 +24,24 @@ top_builddir = @top_builddir@
ALL_ERROR_TEST_CASES := $(patsubst %.i,%, $(notdir $(wildcard $(srcdir)/*.i)))
CPP_ERROR_TEST_CASES := $(filter cpp_%, $(ALL_ERROR_TEST_CASES))
C_ERROR_TEST_CASES := $(filter-out $(CPP_ERROR_TEST_CASES), $(ALL_ERROR_TEST_CASES))
DOXYGEN_ERROR_TEST_CASES := $(filter doxygen_%, $(C_ERROR_TEST_CASES))
C_ERROR_TEST_CASES := $(filter-out $(DOXYGEN_ERROR_TEST_CASES), $(C_ERROR_TEST_CASES))
# Always use C++ for Doxygen tests, there doesn't seem to be any need to
# distinguish between C and C++ Doxygen tests.
DOXYGEN_ERROR_TEST_CASES := $(DOXYGEN_ERROR_TEST_CASES:=.cpptest)
ERROR_TEST_CASES := $(CPP_ERROR_TEST_CASES:=.cpptest) \
$(C_ERROR_TEST_CASES:=.ctest)
$(C_ERROR_TEST_CASES:=.ctest) \
$(DOXYGEN_ERROR_TEST_CASES)
include $(srcdir)/../common.mk
# This is tricky: we need to let common.mk define SWIGOPT before appending to
# it, if we do it before including it, its defining of SWIGOPT would override
# whatever we do here.
$(DOXYGEN_ERROR_TEST_CASES): SWIGOPT += -doxygen
# Portable dos2unix / todos for stripping CR
TODOS = tr -d '\r'
#TODOS = sed -e 's/\r$$//' # On OSX behaves as if written 's/r$$//'

View file

@ -0,0 +1,6 @@
%module xxx
/**
There is an \unknown Doxygen comment here.
*/
void foo();

View file

@ -0,0 +1 @@
doxygen_unknown_command.i:4: Warning 720: Doxygen parser warning: unknown command "unknown".