From 5e8f053d3340fb181df8a0e7842ac539eda56e9d Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 6 Feb 2024 13:40:41 +0000 Subject: [PATCH] tests: Exercise gdbus-codegen --interface-info-header with empty input Signed-off-by: Simon McVittie --- gio/tests/codegen.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/gio/tests/codegen.py b/gio/tests/codegen.py index 725b44080..f66b92c8c 100644 --- a/gio/tests/codegen.py +++ b/gio/tests/codegen.py @@ -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 + +G_BEGIN_DECLS + + G_END_DECLS #endif /* __STDOUT__ */""".format(