Add decodetree.py
-----BEGIN PGP SIGNATURE----- iQEcBAABAgAGBQJaj1XrAAoJEGTfOOivfiFfj7YH/32pOjBPefa3LIjFFMzbbv67 B0JEmP6MzOQ8H/FwlK6AsYq/b8S6S9KW0Mco7U1Ijr0BZtjiNm08mtuzsO5deaIZ QWDS6RzZDDTyNuy2y7jXLbUbLlLgeB+hC/TuZ+5yA1QW2tKeKVBQ7b0JH7ms68Dl Z+9ukxM2xseSZPHSj2ZZmIIIN9IKNoXA+MRKBbhpzCeYBm7jNL+ecLuVKeupvLzk ywflc4X2k7KbYA5/wIBR2BESpdtOZRHTjhc3PyiaN5n0JrpA3A3Sopdeb0jSkxyC uwbWGwjrw03NHudDaewHhS6c7mN+jIakP+sHczf3lNfEZbJC8pp30PgsnEL0mdY= =1wGx -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/rth/tags/pull-decode-20180222' into staging Add decodetree.py # gpg: Signature made Thu 22 Feb 2018 23:44:43 GMT # gpg: using RSA key 64DF38E8AF7E215F # gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" # Primary key fingerprint: 7A48 1E78 868B 4DB6 A85A 05C0 64DF 38E8 AF7E 215F * remotes/rth/tags/pull-decode-20180222: scripts: Add decodetree.py Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
08a6355316
1062
scripts/decodetree.py
Executable file
1062
scripts/decodetree.py
Executable file
File diff suppressed because it is too large
Load Diff
@ -932,6 +932,13 @@ $(patsubst %, check-%, $(check-qapi-schema-y)): check-%.json: $(SRC_PATH)/%.json
|
|||||||
check-tests/qapi-schema/doc-good.texi: tests/qapi-schema/doc-good.test.texi
|
check-tests/qapi-schema/doc-good.texi: tests/qapi-schema/doc-good.test.texi
|
||||||
@diff -q $(SRC_PATH)/tests/qapi-schema/doc-good.texi $<
|
@diff -q $(SRC_PATH)/tests/qapi-schema/doc-good.texi $<
|
||||||
|
|
||||||
|
.PHONY: check-decodetree
|
||||||
|
check-decodetree:
|
||||||
|
$(call quiet-command, \
|
||||||
|
cd $(SRC_PATH)/tests/decode && \
|
||||||
|
./check.sh "$(PYTHON)" "$(SRC_PATH)/scripts/decodetree.py", \
|
||||||
|
TEST, decodetree.py)
|
||||||
|
|
||||||
# Consolidated targets
|
# Consolidated targets
|
||||||
|
|
||||||
.PHONY: check-qapi-schema check-qtest check-unit check check-clean
|
.PHONY: check-qapi-schema check-qtest check-unit check check-clean
|
||||||
@ -940,7 +947,7 @@ check-qtest: $(patsubst %,check-qtest-%, $(QTEST_TARGETS))
|
|||||||
check-unit: $(patsubst %,check-%, $(check-unit-y))
|
check-unit: $(patsubst %,check-%, $(check-unit-y))
|
||||||
check-speed: $(patsubst %,check-%, $(check-speed-y))
|
check-speed: $(patsubst %,check-%, $(check-speed-y))
|
||||||
check-block: $(patsubst %,check-%, $(check-block-y))
|
check-block: $(patsubst %,check-%, $(check-block-y))
|
||||||
check: check-qapi-schema check-unit check-qtest
|
check: check-qapi-schema check-unit check-qtest check-decodetree
|
||||||
check-clean:
|
check-clean:
|
||||||
$(MAKE) -C tests/tcg clean
|
$(MAKE) -C tests/tcg clean
|
||||||
rm -rf $(check-unit-y) tests/*.o $(QEMU_IOTESTS_HELPERS-y)
|
rm -rf $(check-unit-y) tests/*.o $(QEMU_IOTESTS_HELPERS-y)
|
||||||
|
18
tests/decode/check.sh
Executable file
18
tests/decode/check.sh
Executable file
@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# This work is licensed under the terms of the GNU LGPL, version 2 or later.
|
||||||
|
# See the COPYING.LIB file in the top-level directory.
|
||||||
|
|
||||||
|
PYTHON=$1
|
||||||
|
DECODETREE=$2
|
||||||
|
E=0
|
||||||
|
|
||||||
|
# All of these tests should produce errors
|
||||||
|
for i in err_*.decode; do
|
||||||
|
if $PYTHON $DECODETREE $i > /dev/null 2> /dev/null; then
|
||||||
|
# Pass, aka failed to fail.
|
||||||
|
echo FAIL: $i 1>&2
|
||||||
|
E=1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
exit $E
|
5
tests/decode/err_argset1.decode
Normal file
5
tests/decode/err_argset1.decode
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# This work is licensed under the terms of the GNU LGPL, version 2 or later.
|
||||||
|
# See the COPYING.LIB file in the top-level directory.
|
||||||
|
|
||||||
|
# Diagnose duplicate member names
|
||||||
|
&args a a
|
5
tests/decode/err_argset2.decode
Normal file
5
tests/decode/err_argset2.decode
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# This work is licensed under the terms of the GNU LGPL, version 2 or later.
|
||||||
|
# See the COPYING.LIB file in the top-level directory.
|
||||||
|
|
||||||
|
# Diagnose invalid member names
|
||||||
|
&args a b c d0 0e
|
5
tests/decode/err_field1.decode
Normal file
5
tests/decode/err_field1.decode
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# This work is licensed under the terms of the GNU LGPL, version 2 or later.
|
||||||
|
# See the COPYING.LIB file in the top-level directory.
|
||||||
|
|
||||||
|
# Diagnose invalid field syntax
|
||||||
|
%field asdf
|
5
tests/decode/err_field2.decode
Normal file
5
tests/decode/err_field2.decode
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# This work is licensed under the terms of the GNU LGPL, version 2 or later.
|
||||||
|
# See the COPYING.LIB file in the top-level directory.
|
||||||
|
|
||||||
|
# Diagnose invalid field width.
|
||||||
|
%field 0:33
|
5
tests/decode/err_field3.decode
Normal file
5
tests/decode/err_field3.decode
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# This work is licensed under the terms of the GNU LGPL, version 2 or later.
|
||||||
|
# See the COPYING.LIB file in the top-level directory.
|
||||||
|
|
||||||
|
# Diagnose invalid field position.
|
||||||
|
%field 31:2
|
6
tests/decode/err_field4.decode
Normal file
6
tests/decode/err_field4.decode
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
# This work is licensed under the terms of the GNU LGPL, version 2 or later.
|
||||||
|
# See the COPYING.LIB file in the top-level directory.
|
||||||
|
|
||||||
|
# Diagnose duplicate field name.
|
||||||
|
%field 0:1
|
||||||
|
%field 0:1
|
5
tests/decode/err_field5.decode
Normal file
5
tests/decode/err_field5.decode
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# This work is licensed under the terms of the GNU LGPL, version 2 or later.
|
||||||
|
# See the COPYING.LIB file in the top-level directory.
|
||||||
|
|
||||||
|
# Diagnose duplicate function specifier.
|
||||||
|
%field 0:1 !function=a !function=a
|
6
tests/decode/err_init1.decode
Normal file
6
tests/decode/err_init1.decode
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
# This work is licensed under the terms of the GNU LGPL, version 2 or later.
|
||||||
|
# See the COPYING.LIB file in the top-level directory.
|
||||||
|
|
||||||
|
# Diagnose uninitialized member in pattern.
|
||||||
|
&args a b
|
||||||
|
insn 00000000 00000000 00000000 b:8 &args
|
6
tests/decode/err_init2.decode
Normal file
6
tests/decode/err_init2.decode
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
# This work is licensed under the terms of the GNU LGPL, version 2 or later.
|
||||||
|
# See the COPYING.LIB file in the top-level directory.
|
||||||
|
|
||||||
|
# Diagnose member initialized twice in pattern.
|
||||||
|
&args a b
|
||||||
|
insn 00000000 00000000 a:8 b:8 &args a=1
|
7
tests/decode/err_init3.decode
Normal file
7
tests/decode/err_init3.decode
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# This work is licensed under the terms of the GNU LGPL, version 2 or later.
|
||||||
|
# See the COPYING.LIB file in the top-level directory.
|
||||||
|
|
||||||
|
# Diagnose member initialized twice in pattern + format.
|
||||||
|
&args a
|
||||||
|
@format ........ ........ a:16 &args
|
||||||
|
insn 00000000 00000000 a:16 @format
|
7
tests/decode/err_init4.decode
Normal file
7
tests/decode/err_init4.decode
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# This work is licensed under the terms of the GNU LGPL, version 2 or later.
|
||||||
|
# See the COPYING.LIB file in the top-level directory.
|
||||||
|
|
||||||
|
# Diagnose uninitialized member in pattern + format.
|
||||||
|
&args a b
|
||||||
|
@format ........ ........ a:16 &args
|
||||||
|
insn 00000000 00000000 ........ ........ @format
|
6
tests/decode/err_overlap1.decode
Normal file
6
tests/decode/err_overlap1.decode
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
# This work is licensed under the terms of the GNU LGPL, version 2 or later.
|
||||||
|
# See the COPYING.LIB file in the top-level directory.
|
||||||
|
|
||||||
|
# Diagnose field overlapping fixedbits.
|
||||||
|
%field 0:1
|
||||||
|
insn 00000000 00000000 00000000 00000000 %field
|
6
tests/decode/err_overlap2.decode
Normal file
6
tests/decode/err_overlap2.decode
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
# This work is licensed under the terms of the GNU LGPL, version 2 or later.
|
||||||
|
# See the COPYING.LIB file in the top-level directory.
|
||||||
|
|
||||||
|
# Diagnose field overlapping fixedbits w/format.
|
||||||
|
@format ........ ........ ........ ....... fld:1
|
||||||
|
insn 00000000 00000000 00000000 00000000 @format
|
6
tests/decode/err_overlap3.decode
Normal file
6
tests/decode/err_overlap3.decode
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
# This work is licensed under the terms of the GNU LGPL, version 2 or later.
|
||||||
|
# See the COPYING.LIB file in the top-level directory.
|
||||||
|
|
||||||
|
# Diagnose field overlapping unspecified bits.
|
||||||
|
%field 0:1
|
||||||
|
insn 00000000 00000000 00000000 -------- %field
|
6
tests/decode/err_overlap4.decode
Normal file
6
tests/decode/err_overlap4.decode
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
# This work is licensed under the terms of the GNU LGPL, version 2 or later.
|
||||||
|
# See the COPYING.LIB file in the top-level directory.
|
||||||
|
|
||||||
|
# Diagnose fixed bits overlapping unspecified bits.
|
||||||
|
@format ........ ........ ........ .......-
|
||||||
|
insn 00000000 00000000 00000000 00000000 @format
|
5
tests/decode/err_overlap5.decode
Normal file
5
tests/decode/err_overlap5.decode
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# This work is licensed under the terms of the GNU LGPL, version 2 or later.
|
||||||
|
# See the COPYING.LIB file in the top-level directory.
|
||||||
|
|
||||||
|
# Diagnose overlapping sub-fields.
|
||||||
|
%field 3:5 0:5
|
6
tests/decode/err_overlap6.decode
Normal file
6
tests/decode/err_overlap6.decode
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
# This work is licensed under the terms of the GNU LGPL, version 2 or later.
|
||||||
|
# See the COPYING.LIB file in the top-level directory.
|
||||||
|
|
||||||
|
# Diagnose overlapping fixed bits w/format.
|
||||||
|
@format ........ ........ ........ .......1
|
||||||
|
insn 00000000 00000000 00000000 00000000 @format
|
6
tests/decode/err_overlap7.decode
Normal file
6
tests/decode/err_overlap7.decode
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
# This work is licensed under the terms of the GNU LGPL, version 2 or later.
|
||||||
|
# See the COPYING.LIB file in the top-level directory.
|
||||||
|
|
||||||
|
# Diagnose overlapping patterns.
|
||||||
|
insn1 00000000 00000000 00000000 00000000
|
||||||
|
insn2 00000000 00000000 00000000 00000000
|
5
tests/decode/err_overlap8.decode
Normal file
5
tests/decode/err_overlap8.decode
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# This work is licensed under the terms of the GNU LGPL, version 2 or later.
|
||||||
|
# See the COPYING.LIB file in the top-level directory.
|
||||||
|
|
||||||
|
# Diagnose not specified bit (. vs -).
|
||||||
|
insn 00000000 00000000 00000000 0000000.
|
6
tests/decode/err_overlap9.decode
Normal file
6
tests/decode/err_overlap9.decode
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
# This work is licensed under the terms of the GNU LGPL, version 2 or later.
|
||||||
|
# See the COPYING.LIB file in the top-level directory.
|
||||||
|
|
||||||
|
# Diagnose not specified bit (. vs -) w/format.
|
||||||
|
@format ........ a:8 ........ b:7 .
|
||||||
|
insn 00000000 ........ 00000000 ........ @format
|
Loading…
Reference in New Issue
Block a user