diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2008-02-15 15:14:16 +1100 |
---|---|---|
committer | Jon Loeliger <jdl@freescale.com> | 2008-02-15 08:10:14 -0600 |
commit | d8b69426662f29f0cdaf67d380a0b366ba420abd (patch) | |
tree | c177656cae12aacdd5b7ade40dff7660e4e9a127 /tests | |
parent | 089adb9964a222499eb204198b579c231c59c42f (diff) | |
download | dtc-d8b69426662f29f0cdaf67d380a0b366ba420abd.tar.gz |
dtc: Fold comment handling test into testsuite
For ages dtc has included a sample dts, comment-test.dts, for checking
various lexical corner cases in comment processing. In fact, it
predates the automated testsuite, and has never been integrated into
it. This patch addresses this oversight, folding the comment handling
test in with the rest of the testsuite.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/comments-cmp.dts | 16 | ||||
-rw-r--r-- | tests/comments.dts | 39 | ||||
-rwxr-xr-x | tests/run_tests.sh | 4 |
3 files changed, 59 insertions, 0 deletions
diff --git a/tests/comments-cmp.dts b/tests/comments-cmp.dts new file mode 100644 index 0000000..4ee9f52 --- /dev/null +++ b/tests/comments-cmp.dts @@ -0,0 +1,16 @@ +/dts-v1/; + +/ { + prop1; + prop2; + prop3; + prop4; + prop5; + prop6; + prop7; + prop8; + prop9; + prop10; + child { + }; +}; diff --git a/tests/comments.dts b/tests/comments.dts new file mode 100644 index 0000000..0b04b6b --- /dev/null +++ b/tests/comments.dts @@ -0,0 +1,39 @@ +/* regexps for lexing comments are.. tricky. Check if we've actually + * got it right */ +/dts-v1/; + +/ { + // line comment + prop1; + /* comment */ + prop2; + /* multiline + + notaprop1; + + comment */ + prop3; + /**/ + prop4; + /***/ + prop5; + /****/ + prop6; + /* another + * multiline + * comment */ + prop7; + /* yet + * another + * multline + * comment + */ + prop8; + /** try this */ + prop9; + /* and this **/ + prop10; + child /* finally */ { + }; +}; +/* final comment */ diff --git a/tests/run_tests.sh b/tests/run_tests.sh index 02b1fb0..73b9d81 100755 --- a/tests/run_tests.sh +++ b/tests/run_tests.sh @@ -154,6 +154,10 @@ dtc_tests () { run_test dtc.sh -I dts -O dtb -o dtc_path-references.test.dtb path-references.dts run_test path-references dtc_path-references.test.dtb + run_test dtc.sh -I dts -O dtb -o dtc_comments.test.dtb comments.dts + run_test dtc.sh -I dts -O dtb -o dtc_comments-cmp.test.dtb comments-cmp.dts + run_test dtbs_equal_ordered dtc_comments.test.dtb dtc_comments-cmp.test.dtb + # Check -Odts mode preserve all dtb information for tree in test_tree1.dtb dtc_tree1.test.dtb dtc_escapes.test.dtb ; do run_test dtc.sh -I dtb -O dts -o odts_$tree.test.dts $tree |