scripts: rework edtlib warnings-turned-errors
Create a "global" gen_defines.py option and edtlib.EDT constructor
kwarg that turns edtlib-specific warnings into errors. This applies to
edtlib-specific warnings only. Warnings that are just dupes of dtc
warnings are not affected.
Use it from twister to increase DT testing coverage in upstream zephyr.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
diff --git a/scripts/dts/gen_defines.py b/scripts/dts/gen_defines.py
index 42592cb..5b7138a 100755
--- a/scripts/dts/gen_defines.py
+++ b/scripts/dts/gen_defines.py
@@ -69,8 +69,7 @@
"-Wno-simple_bus_reg" not in args.dtc_flags,
default_prop_types=True,
infer_binding_for_paths=["/zephyr,user"],
- err_on_deprecated_properties=
- args.err_on_deprecated_properties,
+ werror=args.edtlib_Werror,
vendor_prefixes=vendor_prefixes)
except edtlib.EDTError as e:
sys.exit(f"devicetree error: {e}")
@@ -217,8 +216,10 @@
help="path to write pickled edtlib.EDT object to")
parser.add_argument("--vendor-prefixes",
help="vendor-prefixes.txt path; used for validation")
- parser.add_argument("--err-on-deprecated-properties", action="store_true",
- help="if set, deprecated property usage is an error")
+ parser.add_argument("--edtlib-Werror", action="store_true",
+ help="if set, edtlib-specific warnings become errors. "
+ "(this does not apply to warnings shared "
+ "with dtc.)")
return parser.parse_args()