diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2020-10-07 11:27:08 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2020-10-08 08:47:33 +0200 |
commit | 8454159107b70ba023fc2ed90623e30e10703648 (patch) | |
tree | e71c0e4ad70fa879840329616db77b66935bb88b | |
parent | interfacedoc: Various improvements (diff) | |
download | rtems-central-8454159107b70ba023fc2ed90623e30e10703648.tar.bz2 |
interface: Add "Generated from ..." comments
-rw-r--r-- | rtemsspec/interface.py | 2 | ||||
-rw-r--r-- | rtemsspec/tests/test_interface.py | 30 |
2 files changed, 32 insertions, 0 deletions
diff --git a/rtemsspec/interface.py b/rtemsspec/interface.py index a8a00f80..0d5d25de 100644 --- a/rtemsspec/interface.py +++ b/rtemsspec/interface.py @@ -210,6 +210,7 @@ class Node: self.content.append(f"}} {name};") def _generate(self) -> None: + self.content.add(f"/* Generated from spec:{self.item.uid} */") _NODE_GENERATORS[self.item["interface-type"]](self) def generate(self) -> None: @@ -517,6 +518,7 @@ class _HeaderFile: self._content.add_brief_description(self._item["brief"]) self._content.add_copyrights_and_licenses() self._content.add_automatically_generated_warning() + self._content.add(f"/* Generated from spec:{self._item.uid} */") with self._content.header_guard(self._item["path"]): exp_mapper = _HeaderExpressionMapper(self._item, self.enabled_by_defined) diff --git a/rtemsspec/tests/test_interface.py b/rtemsspec/tests/test_interface.py index f518c16b..357a411f 100644 --- a/rtemsspec/tests/test_interface.py +++ b/rtemsspec/tests/test_interface.py @@ -99,6 +99,8 @@ def test_interface(tmpdir): * https://docs.rtems.org/branches/master/eng/req/howto.html */ +/* Generated from spec:/h */ + #ifndef _H_H #define _H_H @@ -118,6 +120,8 @@ def test_interface(tmpdir): extern "C" { #endif +/* Generated from spec:/ga */ + /** * @defgroup GroupA Group A * @@ -126,15 +130,21 @@ extern "C" { * Group A description. */ +/* Generated from spec:/gb */ + /** * @defgroup GroupB Group B * * @ingroup GroupA */ +/* Generated from spec:/forward-decl */ + /* Forward declaration */ struct Struct; +/* Generated from spec:/enum */ + /** * @ingroup GroupB * @@ -159,6 +169,8 @@ typedef enum { ENUMERATOR_2 } Enum; +/* Generated from spec:/define */ + /** * @ingroup GroupA */ @@ -171,6 +183,8 @@ typedef enum { ((float_t) 123) #endif +/* Generated from spec:/enum3 */ + /** * @ingroup GroupB * @@ -183,6 +197,8 @@ typedef enum EnumB { ENUMERATOR_B = ENUMERATOR_A } EnumB; +/* Generated from spec:/func */ + /** * @ingroup GroupA * @@ -202,6 +218,8 @@ typedef enum EnumB { */ void Function( int Param0, const int *Param1, int *Param2, int *Param3 ); +/* Generated from spec:/func2 */ + /** * @ingroup GroupB * @@ -241,6 +259,8 @@ static inline int VeryLongFunction( return VeryLongParam0 + 1; } +/* Generated from spec:/macro */ + /** * @ingroup GroupB * @@ -274,6 +294,8 @@ static inline int VeryLongFunction( } while ( 0 ); \\ VeryLongParam0 + 1; +/* Generated from spec:/macro2 */ + /** * @ingroup GroupB * @@ -289,6 +311,8 @@ static inline int VeryLongFunction( #define MACRO( Param0 ) ( ( Param0 ) + 1 ) #endif +/* Generated from spec:/s */ + /** * @ingroup GroupC */ @@ -336,6 +360,8 @@ struct Struct { Enum some_member_4; }; +/* Generated from spec:/td */ + /** * @ingroup GroupB * @@ -345,6 +371,8 @@ struct Struct { */ typedef uint32_t Integer /* Some comment. */; +/* Generated from spec:/td3 */ + /** * @ingroup GroupB */ @@ -353,6 +381,8 @@ typedef uint32_t Integer /* Some comment. */; #endif #if !defined(ASM) + /* Generated from spec:/var */ + /** * @ingroup GroupC * |