mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
C++: issue a better CPP guard and Doxygen file command
Currently we use "<dir><api.location.file>" as \file argument, and as base for the CPP guard. This is not nice when <dir> is absolute, in which case it is expected that the user will use api.location.include to get something nicer. If defined, use that name instead. * data/location.cc (b4_location_path): New. Use it. * tests/c++.at (Shared locations): Check the guard and Doxygen doc.
This commit is contained in:
11
tests/c++.at
11
tests/c++.at
@@ -1324,6 +1324,8 @@ AT_FOR_EACH_CXX([AT_COMPILE_CXX([[input]])])
|
||||
|
||||
AT_CLEANUP
|
||||
|
||||
|
||||
|
||||
## ------------------ ##
|
||||
## Shared locations. ##
|
||||
## ------------------ ##
|
||||
@@ -1368,6 +1370,15 @@ AT_TEST([x1],
|
||||
%define api.location.file "include/ast/loc.hh"
|
||||
%define api.location.include {<ast/loc.hh>}])
|
||||
|
||||
# Check the CPP guard and Doxyen comments.
|
||||
AT_CHECK([sed -ne '/INCLUDED/p;/\\file/{p;n;p;}' include/ast/loc.hh], [],
|
||||
[[ ** \file ast/loc.hh
|
||||
** Define the x1::location class.
|
||||
#ifndef YY_YY_AST_LOC_HH_INCLUDED
|
||||
# define YY_YY_AST_LOC_HH_INCLUDED
|
||||
#endif // !YY_YY_AST_LOC_HH_INCLUDED
|
||||
]])
|
||||
|
||||
AT_TEST([x2],
|
||||
[%defines
|
||||
%locations
|
||||
|
||||
Reference in New Issue
Block a user