Lines Matching full:dts

29 def parse(dts, include_path=(), **kwargs):  argument
30 '''Parse a DTS string 'dts', using the given include path.
34 fd, path = tempfile.mkstemp(prefix='pytest-', suffix='.dts')
36 os.write(fd, dts.encode('utf-8'))
42 def verify_parse(dts, expected, include_path=()): argument
49 dt = parse(dts[1:], include_path)
53 assert actual == expected, f'unexpected round-trip on {dts}'
57 def verify_error(dts, expected_msg): argument
58 '''Verify that parsing 'dts' results in a DTError with the
62 parse(dts[1:])
64 def verify_error_endswith(dts, expected_msg): argument
71 parse(dts[1:])
73 def verify_error_matches(dts, expected_re): argument
80 parse(dts[1:])
129 /dts-v1/;
138 /dts-v1/;
156 /dts-v1/;
175 /dts-v1/;
184 /dts-v1/;
193 /dts-v1/;
205 /dts-v1/;
214 /dts-v1/;
224 /dts-v1/;
236 /dts-v1/;
245 /dts-v1/;
255 /dts-v1/;
267 /dts-v1/;
275 /dts-v1/;
284 /dts-v1/;
294 /dts-v1/;
303 /dts-v1/;
320 /dts-v1/;
329 /dts-v1/;
339 /dts-v1/;
346 /dts-v1/;
355 /dts-v1/;
370 /dts-v1/;
409 /dts-v1/;
430 /dts-v1/;
441 /dts-v1/;
452 /dts-v1/;
470 /dts-v1/;
486 /dts-v1/;
517 /dts-v1/;
530 /dts-v1/;
561 /dts-v1/;
575 /dts-v1/;
595 /dts-v1/;
609 /dts-v1/;
624 /dts-v1/;
635 /dts-v1/;
649 /dts-v1/;
674 /dts-v1/;
699 /dts-v1/;
716 /dts-v1/;
732 /dts-v1/;
743 /dts-v1/;
754 /dts-v1/;
765 /dts-v1/;
776 /dts-v1/;
787 /dts-v1/;
802 /dts-v1/;
826 /dts-v1/;
852 /dts-v1/;
867 /dts-v1/;
883 /dts-v1/;
900 /dts-v1/;
912 /dts-v1/;
945 /dts-v1/;
955 /dts-v1/;
971 /dts-v1/;
978 /dts-v1/;
988 /dts-v1/;
1013 with open("test.dts", "w") as f:
1015 /dts-v1/;
1021 dt = dtlib.DT("test.dts")
1023 /dts-v1/;
1037 with open(tmp_path / "tmp2.dts", "w") as f:
1039 /dts-v1/;
1042 with open(tmp_path / "tmp3.dts", "w") as f:
1062 with open(tmp_path / "test.dts", "w") as test_dts:
1064 /include/ "tmp2.dts"
1065 /include/ "tmp3.dts"
1070 dt = dtlib.DT("test.dts", include_path=(subdir_1, subdir_2))
1072 /dts-v1/;
1094 with open("tmp2.dts", "w") as f:
1100 with open("tmp.dts", "w") as f:
1104 /include/ "tmp2.dts"
1106 with dtlib_raises("tmp2.dts:3 (column 3): parse error: "
1107 "expected '/dts-v1/;' at start of file"):
1108 dtlib.DT("tmp.dts")
1114 with open("tmp2.dts", "w") as f:
1115 f.write('/include/ "tmp3.dts"\n')
1116 with open("tmp3.dts", "w") as f:
1117 f.write('/include/ "tmp.dts"\n')
1119 with open("tmp.dts", "w") as f:
1120 f.write('/include/ "tmp2.dts"\n')
1122 tmp3.dts:1 (column 1): parse error: recursive /include/:
1123 tmp.dts:1 ->
1124 tmp2.dts:1 ->
1125 tmp3.dts:1 ->
1126 tmp.dts"""
1128 dtlib.DT("tmp.dts")
1130 with open("tmp.dts", "w") as f:
1131 f.write('/include/ "tmp.dts"\n')
1133 tmp.dts:1 (column 1): parse error: recursive /include/:
1134 tmp.dts:1 ->
1135 tmp.dts"""
1137 dtlib.DT("tmp.dts")
1148 /dts-v1/;
1180 /dts-v1/;
1193 /dts-v1/;
1202 /dts-v1/;
1211 /dts-v1/;
1221 /dts-v1/;
1230 /dts-v1/;
1240 /dts-v1/;
1250 /dts-v1/;
1302 /dts-v1/;
1355 /dts-v1/;
1364 /dts-v1/;
1376 /**//dts-v1//**/;//
1385 /dts-v1/;
1412 /dts-v1/;
1470 /dts-v1/;
1514 /dts-v1/;
1526 /dts-v1/;
1538 /dts-v1/;
1549 /dts-v1/;
1567 /dts-v1/;
1629 /dts-v1/;
1915 /dts-v1/;
1932 /dts-v1/;
1950 /dts-v1/;
1961 /dts-v1/;
1973 /dts-v1/;
1983 /dts-v1/;
2000 /dts-v1/;
2012 /dts-v1/;
2024 /dts-v1/;
2037 /dts-v1/;
2052 /dts-v1/;
2066 /dts-v1/;
2075 /dts-v1/;
2090 /dts-v1/;
2099 /dts-v1/;
2112 /dts-v1/;
2122 dts = """
2123 /dts-v1/;
2133 dt = parse(dts, include_path=("foo", "bar"))
2142 dt = parse(dts, include_path=iter(("foo", "bar")))
2151 /dts-v1/;
2175 /dts-v1/;
2193 /dts-v1/;
2202 /dts-v1/;
2211 /dts-v1/;
2222 Test that a densely written DTS input round-trips to something
2227 /dts-v1/;/{l1:l2:foo{l3:l4:bar{l5:x=l6:/bits/8<l7:1 l8:2>l9:,[03],"a";};};};
2230 /dts-v1/;
2244 verify_error_endswith("", ":1 (column 1): parse error: expected '/dts-v1/;' at start of file")
2247 /dts-v1/;
2252 /dts-v1/; /plugin/;
2257 /dts-v1/;
2271 /dts-v1/;
2279 # Multiple /dts-v1/ at the start of a file is fine
2281 /dts-v1/;
2282 /dts-v1/;
2288 /dts-v1/;
2296 /dts-v1/;
2310 /dts-v1/;
2319 /dts-v1/;
2329 /dts-v1/;
2340 /dts-v1/;
2453 /dts-v1/;