tests: Exercise gdbus-codegen --interface-info-header with empty input

Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
Simon McVittie 2024-02-06 13:40:41 +00:00
parent 02a3417ac4
commit 5e8f053d33

View File

@ -367,6 +367,31 @@ class TestCodegen(unittest.TestCase):
G_BEGIN_DECLS
G_END_DECLS
#endif /* __STDOUT__ */""".format(
**result.subs
),
result.out.strip(),
)
def test_empty_interface_info_header(self):
"""Test generating a header with an empty interface file."""
result = self.runCodegenWithInterface(
"", "--output", "-", "--interface-info-header"
)
self.assertEqual("", result.err)
self.assertEqual(
"""{standard_top_comment}
#ifndef __STDOUT__
#define __STDOUT__
#include <gio/gio.h>
G_BEGIN_DECLS
G_END_DECLS
#endif /* __STDOUT__ */""".format(