mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
Emit deprecation warnings
This commit is contained in:
parent
8fab7c1706
commit
94db929f74
9 changed files with 102 additions and 2 deletions
10
tests/sample_errors/deprecations.blp
Normal file
10
tests/sample_errors/deprecations.blp
Normal 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();
|
||||
}
|
1
tests/sample_errors/deprecations.err
Normal file
1
tests/sample_errors/deprecations.err
Normal file
|
@ -0,0 +1 @@
|
|||
4,1,6,Gtk.Dialog is deprecated
|
|
@ -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)
|
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue