Emit deprecation warnings

This commit is contained in:
James Westman 2023-07-23 18:04:10 -05:00
parent 8fab7c1706
commit 94db929f74
9 changed files with 102 additions and 2 deletions

View file

@ -0,0 +1,10 @@
using Gtk 4.0;
using Gio 2.0;
Dialog {
use-header-bar: 1;
}
Window {
keys-changed => $on_window_keys_changed();
}

View file

@ -0,0 +1 @@
4,1,6,Gtk.Dialog is deprecated

View file

@ -1,2 +1,3 @@
3,10,12,Use type syntax here (introduced in blueprint 0.8.0)
8,1,6,Gtk.Dialog is deprecated
9,18,12,Use 'template' instead of the class name (introduced in 0.8.0)

View file

@ -54,6 +54,14 @@ class TestSamples(unittest.TestCase):
tokens = tokenizer.tokenize(blueprint)
ast, errors, warnings = parser.parse(tokens)
# Ignore deprecation warnings because some of the things we're testing
# are deprecated
warnings = [
warning
for warning in warnings
if "is deprecated" not in warning.message
]
if errors:
raise errors
if len(warnings):